Merge pull request #22 from datagutten/dependabot/npm_and_yarn/multi-… #10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish Docker image | |
| on: | |
| push: | |
| branches: [ master ] | |
| workflow_dispatch: | |
| jobs: | |
| push_to_registry: | |
| name: Push Docker image to Docker Hub | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| language: [ no, sv, da, nl ] | |
| permissions: | |
| packages: write | |
| contents: read | |
| attestations: write | |
| id-token: write | |
| steps: | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Check out the repo | |
| uses: actions/checkout@v4 | |
| - name: Log in to registry | |
| uses: docker/login-action@v3.3.0 | |
| with: | |
| registry: docker.datagutten.net | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| - name: Extract metadata (tags, labels) for Docker | |
| id: meta | |
| uses: docker/metadata-action@v5.6.1 | |
| with: | |
| images: datagutten/mulle_js | |
| - name: Cache data | |
| uses: actions/cache@v4 | |
| id: iso | |
| with: | |
| path: iso/mullebil_${{ matrix.language }}.iso | |
| key: game-iso-${{ matrix.language }}-${{ hashFiles('iso/mullebil_*.iso') }} | |
| restore-keys: game-iso-${{ matrix.language }}- | |
| - name: Download game | |
| run: python build_scripts/build.py ${{ matrix.language }} download-only | |
| - name: Build and push Docker image | |
| id: push | |
| uses: docker/build-push-action@v6 | |
| with: | |
| push: true | |
| tags: docker.datagutten.net/mulle_js_${{ matrix.language }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| build-contexts: iso=iso | |
| build-args: | | |
| GAME_LANG=${{ matrix.language }} | |
| OPTIPNG_LEVEL=0 | |
| - name: Generate artifact attestation | |
| uses: actions/attest-build-provenance@v2 | |
| with: | |
| subject-name: docker.datagutten.net/mulle_js_${{ matrix.language }} | |
| subject-digest: ${{ steps.push.outputs.digest }} | |
| push-to-registry: true |