This commit is contained in:
parent
5d6adb88d8
commit
8747c308e5
69
.gitea/workflows/create_image.yaml
Normal file
69
.gitea/workflows/create_image.yaml
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
name: Build and Push Docker Image
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- "v*.*.*"
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Build image
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container: ghcr.io/catthehacker/ubuntu:act-latest
|
||||||
|
env:
|
||||||
|
IMAGE_NAME: headscale-controller
|
||||||
|
REGISTRY: git.acooldomain.co
|
||||||
|
REPO_OWNER: acoolname
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Docker meta
|
||||||
|
id: meta
|
||||||
|
uses: docker/metadata-action@v5
|
||||||
|
with:
|
||||||
|
images: |
|
||||||
|
gitea.example.com/xyz/alpine
|
||||||
|
tags: |
|
||||||
|
type=schedule,pattern={{date 'YYYYMMDDHHMM'}}
|
||||||
|
type=semver,pattern={{version}}
|
||||||
|
type=semver,pattern={{major}}.{{minor}}
|
||||||
|
type=semver,pattern={{major}}
|
||||||
|
type=sha
|
||||||
|
- name: Set up Docker Context for Buildx
|
||||||
|
id: buildx-context
|
||||||
|
run: |
|
||||||
|
export DOCKER_HOST=tcp://docker:2376/
|
||||||
|
export DOCKER_TLS_CERTDIR="/certs"
|
||||||
|
export DOCKER_TLS_VERIFY=1
|
||||||
|
export DOCKER_CERT_PATH="/certs/client"
|
||||||
|
docker context create builders
|
||||||
|
# https://github.com/docker/setup-buildx-action
|
||||||
|
# https://docs.docker.com/engine/reference/commandline/cli/#environment-variables
|
||||||
|
- name: Setup Docker Buildx
|
||||||
|
id: buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
with:
|
||||||
|
# buildkitd-flags: --debug
|
||||||
|
endpoint: builders
|
||||||
|
env:
|
||||||
|
DOCKER_HOST: "tcp://docker:2376/"
|
||||||
|
DOCKER_TLS_CERTDIR: "/certs"
|
||||||
|
DOCKER_TLS_VERIFY: 1
|
||||||
|
DOCKER_CERT_PATH: "/certs/client"
|
||||||
|
|
||||||
|
- name: Login to Docker Hub
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: git.acooldomain.co
|
||||||
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||||
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||||
|
- name: Build and push
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
push: true
|
||||||
|
tags: "git.acooldomain.co/server-manager/backend:${{gitea.ref_name}}"
|
||||||
|
env:
|
||||||
|
DOCKER_HOST: "tcp://docker:2376/"
|
||||||
|
DOCKER_TLS_CERTDIR: "/certs"
|
||||||
|
DOCKER_TLS_VERIFY: 1
|
||||||
|
DOCKER_CERT_PATH: "/certs/client"
|
Loading…
x
Reference in New Issue
Block a user