Skip to content

Update ci-nullplatform.yml #18

Update ci-nullplatform.yml

Update ci-nullplatform.yml #18

Workflow file for this run

name: ci-nullplatform
on:
push:
branches:
- main
permissions:
id-token: write
contents: read
packages: read
jobs:
fetch-data:
runs-on: ubuntu-latest
steps:
- name: Checkout
id: checkout-code
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Get changed applications
id: get-changed-applications
run: |
changed_applications=$(git diff --name-only HEAD^ HEAD -- apps | cut -d / -f 1,2 | uniq | paste -sd "," -)
echo "Changed applications: $changed_applications"
echo "applications=$changed_applications" >> $GITHUB_OUTPUT
- name: Start Nullplatform CI for changed applications
id: nullplatform-ci-monorepo
uses: nullplatform/github-action-setup-ci@v1
with:
api-key: ${{ secrets.NULLPLATFORM_API_KEY }}
monorepo: true
applications-path: ${{ steps.get-changed-applications.outputs.applications }}
outputs:
metadata: ${{ steps.nullplatform-ci-monorepo.outputs.applications }}
build:
needs: fetch-data
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
application: ${{ fromJson(needs.fetch-data.outputs.metadata) }}
steps:
- name: Start Nullplatform CI
id: nullplatform-ci
uses: nullplatform/github-action-setup-ci@v1
with:
api-key: ${{ secrets.NULLPLATFORM_API_KEY }}
application-id: ${{ matrix.application.id }}
- name: Get build parameters
id: get-build-parameters
uses: nullplatform/github-action-parameter@v1
with:
application-id: ${{ matrix.application.id }}
- name: Build asset for ${{ matrix.application.name }}
id: build-asset
uses: nullplatform/github-action-asset-build@v1
with:
build-working-directory: ${{ matrix.application.code_repository.application_path }}
asset-working-directory: ${{ matrix.application.code_repository.application_path }}
name: ${{ matrix.application.slug }}
- name: Push asset for ${{ matrix.application.name }}
id: push-asset
uses: nullplatform/github-action-asset-push@v1
with:
build-working-directory: ${{ matrix.application.code_repository.application_path }}
asset-working-directory: ${{ matrix.application.code_repository.application_path }}
name: ${{ matrix.application.slug }}
build-id: ${{ steps.nullplatform-ci.outputs.build-id }}
type: docker-image
- name: End Nullplatform CI
if: ${{ always() }}
id: end-nullplatform-ci
uses: nullplatform/github-action-setup-ci@v1
with:
build-id: ${{ steps.nullplatform-ci.outputs.build-id }}
status: ${{ contains(fromJSON('["failure", "cancelled"]'), job.status) && 'failed' || 'successful' }}