Fix matrix setup #27
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: ci-nullplatform | |
env: | |
NULLPLATFORM_API_KEY: ${{ secrets.NULLPLATFORM_API_KEY }} | |
on: | |
push: | |
branches: | |
- master | |
- main | |
- fix/runner-authorization | |
permissions: | |
id-token: write | |
contents: read | |
packages: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
platform: | |
- asset-arch: linux/amd64 | |
runner-arch: linux-x64 | |
asset-name: runner-linux-amd64 | |
- asset-arch: linux/arm64 | |
runner-arch: linux-arm64 | |
asset-name: runner-linux-arm64 | |
steps: | |
- name: Install nullplatform cli | |
run: curl https://cli.nullplatform.com/install.sh | sh | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Start nullplatform CI | |
run: np build start | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build asset | |
run: docker buildx build --build-arg ARCH=${{ matrix.platform.runner-arch }} --platform ${{ matrix.platform.asset-arch }} -t ${{ matrix.platform.asset-name }} --load . | |
- name: Push ARM asset | |
run: np asset push --type docker-image --source ${{ matrix.platform.asset-name }} --name ${{ matrix.platform.asset-name }} | |
- name: End nullplatform CI | |
if: ${{ always() }} | |
run: np build update --status ${{ contains(fromJSON('["failure", "cancelled"]'), job.status) && 'failed' || 'successful' }} |