[release] fix docker image builder #36
Workflow file for this run
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: Build Docker Image | |
# Release on any git tag | |
on: | |
push: | |
tags: ['*'] | |
jobs: | |
build: | |
runs-on: [self-hosted, linux, nixos] | |
strategy: | |
matrix: | |
config: | |
- blastoise | |
- rookidee | |
outputs: | |
# I hate copy-paste too, but this is GitHub Action, blame them. | |
cache-key-blastoise: ${{ steps.build.outputs.cache-key-blastoise }} | |
cache-key-rookidee: ${{ steps.build.outputs.cache-key-rookidee }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
# Checkout the triggered tag name | |
ref: ${{ github.ref_name }} | |
- name: Build docker image file | |
id: build | |
env: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
export PATH="$(nix build '.#skopeo.out' --print-out-paths --no-link)/bin:$PATH" | |
export PATH="$(nix build '.#gzip.out' --print-out-paths --no-link)/bin:$PATH" | |
closure="$(nix build -L '.#t1.${{ matrix.config }}.t1emu.docker-image' --no-link --print-out-paths --impure)" | |
skopeo -u "$username" -p "$password" "$registry" | |
"$closure" \ | |
| gzip --fast \ | |
| skopeo copy docker-archive:/dev/stdin docker://"$registry"/chipsalliance/t1-${{ matrix.config }}:latest |