Added Docker workflow
All checks were successful
Build & Push Docker Image / build-and-push (push) Successful in 6m23s
All checks were successful
Build & Push Docker Image / build-and-push (push) Successful in 6m23s
This commit is contained in:
47
.gitea/workflows/docker.yml
Normal file
47
.gitea/workflows/docker.yml
Normal file
@@ -0,0 +1,47 @@
|
||||
name: Build & Push Docker Image
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v*" # triggers on v0.1.0, v1.0.0, etc.
|
||||
workflow_dispatch: # allow manual trigger from Gitea UI
|
||||
|
||||
env:
|
||||
REGISTRY: git.azuze.fr
|
||||
IMAGE: git.azuze.fr/kawa/cubeadmin
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Extract version tag
|
||||
id: meta
|
||||
run: |
|
||||
TAG="${GITHUB_REF_NAME}" # e.g. v0.1.0
|
||||
VERSION="${TAG#v}" # strip leading v → 0.1.0
|
||||
echo "tag=${TAG}" >> $GITHUB_OUTPUT
|
||||
echo "version=${VERSION}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Log in to Gitea container registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ secrets.REGISTRY_USER }}
|
||||
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: |
|
||||
${{ env.IMAGE }}:latest
|
||||
${{ env.IMAGE }}:${{ steps.meta.outputs.version }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
Reference in New Issue
Block a user