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