# Gitea Actions: builds and pushes the multi-arch MeterVault image on a vX.Y.Z tag (SDD §11). # Pushes to the Gitea container registry on this host. Requires a Docker-capable act_runner and # a token with package:write — the built-in ${{ github.token }} works if the runner is configured # to allow package writes; otherwise set a PACKAGES_TOKEN secret (a PAT with write:package). name: docker-publish on: push: tags: ["v*"] workflow_dispatch: {} env: REGISTRY: git.finalfactory.de permissions: contents: read packages: write jobs: build-and-push: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Derive version and lowercase image name id: meta run: | echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT" echo "image=$(echo '${{ github.repository }}' | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_OUTPUT" - uses: docker/setup-qemu-action@v3 - uses: docker/setup-buildx-action@v3 - name: Log in to the Gitea registry uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.PACKAGES_TOKEN || github.token }} - name: Build and push uses: docker/build-push-action@v6 with: context: . file: deploy/Dockerfile platforms: linux/amd64,linux/arm64 push: true tags: | ${{ env.REGISTRY }}/${{ steps.meta.outputs.image }}:${{ steps.meta.outputs.version }} ${{ env.REGISTRY }}/${{ steps.meta.outputs.image }}:latest cache-from: type=gha cache-to: type=gha,mode=max