Make dependencies optional when using download-only #4
This file contains 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/[email protected] | |
with: | |
registry: docker.datagutten.net | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/[email protected] | |
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/[email protected] | |
with: | |
push: true | |
tags: 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/datagutten/switchinfo | |
subject-digest: ${{ steps.push.outputs.digest }} | |
push-to-registry: true |