name: Test and publish image on: push: branches: [main] tags: ["v*"] pull_request: workflow_dispatch: permissions: contents: read jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6 - uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0 with: python-version: "3.14" - name: Unit, integration and Community Applications checks working-directory: tests run: python -m unittest discover -s . -t . -v image: needs: test runs-on: ubuntu-latest permissions: contents: read packages: write steps: - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6 - uses: docker/setup-qemu-action@99012661954931238ded8c8b007157a8430204e1 # v4.4.0 - uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1 - name: Log in to GHCR if: github.event_name != 'pull_request' uses: docker/login-action@8aa5831fb8d48d8f76594c7ddde61ae58019f550 # v4.8.0 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - id: meta uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302 # v6.2.0 with: images: ghcr.io/mrpatates/endfield-checkin tags: | type=raw,value=latest,enable={{is_default_branch}} type=ref,event=tag type=sha,format=short - name: Read version id: version run: echo "value=$(cat VERSION)" >> "$GITHUB_OUTPUT" - uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0 with: context: . platforms: linux/amd64,linux/arm64 push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} build-args: APP_VERSION=${{ steps.version.outputs.value }}