name: Build fdroidserver-ipfs image # Triggers: # - push to main → immediate rebuild (any change in the repo) # - weekly cron → picks up upstream :master refreshes in # docker-executable-fdroidserver without a # source change here # - manual dispatch → on-demand on: push: branches: [main] schedule: # Sun 04:00 UTC. - cron: "0 4 * * 0" workflow_dispatch: jobs: build: # Skip the job entirely (no runner provisioning) when the registry host # isn't configured — shows as "skipped" in the UI rather than burning # minutes on a build that can't be pushed. Secrets can't be referenced # in job-level if:, so REGISTRY_TOKEN is still checked below. if: vars.REGISTRY_HOST != '' runs-on: ubuntu-docker permissions: packages: write steps: - name: Validate registry token run: | if [ -z "${{ secrets.REGISTRY_TOKEN }}" ]; then echo "::error::Missing required config: secrets.REGISTRY_TOKEN" exit 1 fi - name: Checkout uses: actions/checkout@v4 - name: Set up Buildx uses: docker/setup-buildx-action@v3 - name: Compute date tag id: date run: echo "date=$(date -u +%Y%m%d)" >> "$GITHUB_OUTPUT" - name: Log in to Gitea registry uses: docker/login-action@v3 with: registry: ${{ vars.REGISTRY_HOST }} username: ${{ gitea.actor }} password: ${{ secrets.REGISTRY_TOKEN }} - name: Build and push uses: docker/build-push-action@v5 with: context: . push: true # Two tags: # :stable — moving, what callers pull by default # :YYYYMMDD — immutable, for pinning / rollback tags: | ${{ vars.REGISTRY_HOST }}/ci-images/fdroidserver-ipfs:stable ${{ vars.REGISTRY_HOST }}/ci-images/fdroidserver-ipfs:${{ steps.date.outputs.date }} build-args: | IMAGE_SOURCE=https://${{ vars.REGISTRY_HOST }}/ci-images/fdroidserver-ipfs cache-from: type=registry,ref=${{ vars.REGISTRY_HOST }}/ci-images/fdroidserver-ipfs:stable cache-to: type=inline