From e7c4c931ee1fbcd3acb6be853b378f2cca0cab6f Mon Sep 17 00:00:00 2001 From: John O'Keefe Date: Wed, 29 Jul 2026 16:53:43 -0400 Subject: [PATCH] ci(release): add tag-triggered image build & push to Gitea registry Adds .gitea/workflows/release.yml. On a v* git tag push (or manual dispatch), builds the Dockerfile and publishes to git.linuxhg.com/bookhoard/bookhoard under two tags: the version (${{ gitea.ref_name }}) and 'latest'. Auth uses the auto-provided GITHUB_TOKEN; no secret to manage. Pushes to main do nothing, so work-in-progress commits never ship. --- .gitea/workflows/release.yml | 43 ++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .gitea/workflows/release.yml diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml new file mode 100644 index 0000000..de30899 --- /dev/null +++ b/.gitea/workflows/release.yml @@ -0,0 +1,43 @@ +name: Release + +# Builds and publishes the Bookhoard container image to the Gitea container registry. +# Triggered ONLY by a version tag push (pushing to main does nothing), so work-in-progress +# commits never ship. Each release publishes two image tags: the version and "latest". +on: + push: + tags: + - 'v*' + workflow_dispatch: + +jobs: + build-and-push: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to Gitea Container Registry + uses: docker/login-action@v3 + with: + registry: git.linuxhg.com + username: ${{ gitea.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push image + uses: docker/build-push-action@v5 + with: + context: . + file: ./Dockerfile + push: true + # Publishes both the exact version (e.g. v0.2.0) and the movable "latest" tag. + # Deployments default to "latest" via ${IMAGE_TAG:-latest} in docker-compose.yml; + # pin or roll back by setting IMAGE_TAG in .env. + tags: | + git.linuxhg.com/bookhoard/bookhoard:${{ gitea.ref_name }} + git.linuxhg.com/bookhoard/bookhoard:latest