Files
nhgooi.nl/.gitea/workflows/build-docker.yml
T
eric.busandClaude Opus 5.5 a069fffa5b ci: build the release image on version tags instead of pushes to main
- Triggers on every pushed v* tag, regardless of which files changed
  (no more paths filter / 'version' file bump needed)
- Image is tagged with the version (e.g. v3.0.2), the commit sha and latest

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 09:20:41 +01:00

57 lines
1.5 KiB
YAML

name: Build and Deploy
run-name: ${{ gitea.actor }} is building ${{ gitea.repository }} ${{ gitea.ref_name }}
# Builds a release image for every new version tag (v1.2.3), regardless of
# which files changed. Pushes to main no longer trigger a build.
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
env:
REGISTRY: git.gooienmeer.nl
IMAGE: git.gooienmeer.nl/nh_gooi/nhgooi.nl
# The tag that triggered this build, e.g. v3.0.2
VERSION: ${{ gitea.ref_name }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to Gitea Container Registry
run: |
echo "${{ secrets.REGISTRY_TOKEN }}" | \
docker login "$REGISTRY" \
-u "${{ gitea.actor }}" \
--password-stdin
- name: Build image
run: |
docker build \
-t "$IMAGE:$VERSION" \
-t "$IMAGE:${{ gitea.sha }}" \
-t "$IMAGE:latest" \
.
- name: Push image
run: |
docker push "$IMAGE:$VERSION"
docker push "$IMAGE:${{ gitea.sha }}"
docker push "$IMAGE:latest"
# - name: Trigger deployment
# run: |
# curl --fail-with-body \
# -X POST \
# -H "Content-Type: application/json" \
# -d '{
# "image": "'"$IMAGE:${{ gitea.sha }}"'",
# "commit": "${{ gitea.sha }}",
# "repository": "${{ gitea.repository }}"
# }' \
# "${{ secrets.DEPLOY_WEBHOOK_URL }}"