Build with cli #26
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 --platform ${{ matrix.platform.asset-arch }} -t main --load . | |
- name: Push ARM asset | |
run: np asset push --type docker-image --source main --name ${{ matrix.platform.asset-arch }} | |
- name: End nullplatform CI | |
if: ${{ always() }} | |
run: np build update --status ${{ contains(fromJSON('["failure", "cancelled"]'), job.status) && 'failed' || 'successful' }} |