Skip to content

ci: add app CI workflows #6

ci: add app CI workflows

ci: add app CI workflows #6

Workflow file for this run

name: CI
on:
pull_request:
permissions:
contents: read
jobs:
orchestrator:
name: Orchestrator
runs-on: ubuntu-latest
outputs:
should-build-app: ${{ steps.changed-api-files.outputs.any_changed == 'true' || steps.changed-selfserve-files.outputs.any_changed == 'true' || steps.changed-internal-files.outputs.any_changed == 'true' || null }}
should-build-app-api: ${{ steps.changed-api-files.outputs.any_changed == 'true' || null }}
should-build-app-selfserve: ${{ steps.changed-selfserve-files.outputs.any_changed == 'true' || null }}
should-build-app-internal: ${{ steps.changed-internal-files.outputs.any_changed == 'true' || null }}
should-build-docs: ${{ steps.changed-website-files.outputs.any_changed == 'true' || null }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: tj-actions/changed-files@v42
id: changed-api-files
with:
files: |
app/api/**
# since_last_remote_commit: true
- uses: tj-actions/changed-files@v42
id: changed-selfserve-files
with:
files: |
app/selfserve/**
# since_last_remote_commit: true
- uses: tj-actions/changed-files@v42
id: changed-internal-files
with:
files: |
app/internal/**
# since_last_remote_commit: true
- uses: tj-actions/changed-files@v42
id: changed-website-files
with:
files: |
website/**
docs/**
since_last_remote_commit: true
docs:
name: Documentation
if: ${{ needs.orchestrator.outputs.should-build-docs }}
needs:
- orchestrator
uses: ./.github/workflows/deploy-documentation.yaml
with:
deploy: false
permissions:
contents: write
get-app-versions:
name: Get latest app version
needs:
- orchestrator
if: ${{ needs.orchestrator.outputs.should-build-app }}
runs-on: ubuntu-latest
outputs:
api: ${{ steps.api-version.outputs.version }}
selfserve: ${{ steps.selfserve-version.outputs.version }}
internal: ${{ steps.internal-version.outputs.version }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- id: api-version
uses: ./.github/actions/get-app-version
with:
project-path: app/api
- id: selfserve-version
uses: ./.github/actions/get-app-version
with:
project-path: app/selfserve
- id: internal-version
uses: ./.github/actions/get-app-version
with:
project-path: app/internal
api:
name: API
concurrency:
group: app-api-${{ needs.get-app-versions.outputs.api }}
needs:
- orchestrator
- get-app-versions
if: ${{ needs.orchestrator.outputs.should-build-app-api }}
uses: ./.github/workflows/app.yaml
with:
object-prefix: app-api-${{ needs.get-app-versions.outputs.api }}
project: api
should-upload: ${{ contains(github.event.pull_request.labels.*.name, 'deployed') }}
permissions:
contents: read
id-token: write
selfserve:
name: Selfserve
concurrency:
group: app-selfserve-${{ needs.get-app-versions.outputs.selfserve }}
needs:
- orchestrator
- get-app-versions
if: ${{ needs.orchestrator.outputs.should-build-app-selfserve }}
uses: ./.github/workflows/app.yaml
with:
object-prefix: app-selfserve-${{ needs.get-app-versions.outputs.selfserve }}
project: api
should-upload: ${{ contains(github.event.pull_request.labels.*.name, 'deployed') }}
permissions:
contents: read
id-token: write
internal:
name: Internal
concurrency:
group: app-internal-${{ needs.get-app-versions.outputs.internal }}
needs:
- orchestrator
- get-app-versions
if: ${{ needs.orchestrator.outputs.should-build-app-internal }}
uses: ./.github/workflows/app.yaml
with:
object-prefix: app-internal-${{ needs.get-app-versions.outputs.internal }}
project: api
should-upload: ${{ contains(github.event.pull_request.labels.*.name, 'deployed') }}
permissions:
contents: read
id-token: write