Skip to content

.github/workflows/all.workflows.yml #139

.github/workflows/all.workflows.yml

.github/workflows/all.workflows.yml #139

Workflow file for this run

on:
workflow_dispatch:
inputs:
workflow:
type: choice
description: "Backend or frontend."
options:
- "backend"
- "frontend"
type:
type: choice
description: "App or proxy. Used to resolve the working directory together with name, as <type>/<name>."
options:
- "apps"
- "proxies"
cluster:
type: choice
description: "The cluster to deploy to."
options:
- "dev-gcp"
- "dev-fss"
- "prod-gcp"
name:
type: string
description: "The workflow name, e.g. dolly-backend. Used to resolve the working directory together with type, as <type>/<name>."
required: true
force-deploy:
type: boolean
description: "Deploy? Make sure the effective working directory contains a NAIS manifest as named below! Note: For dolly-frontend, this will also deploy with config.idporten.yml."
default: false
nais-manifest:
type: string
description: "Custom NAIS manifest filename."
default: "config.yml"
force-deploy-test:
type: boolean
description: "Deploy to test? Make sure the effective working directory contains a config.test.yml! Note: For dolly-frontend, this will also deploy with config.unstable.yml."
default: false
permissions:
contents: read
id-token: write
jobs:
start:
runs-on: ubuntu-latest
steps:
- name: "Log inputs"
run: |
echo "branch: ${{ github.ref_name }}"
echo "inputs: ${{ toJSON(inputs) }}"
backend:
needs: start
if: inputs.workflow == 'backend'
uses: ./.github/workflows/common.workflow.backend.yml
with:
cluster: ${{ inputs.cluster }}
working-directory: "${{ inputs.type }}/${{ inputs.name }}"
image-suffix: ${{ inputs.name }}
deploy-tag: ""
force-deploy: ${{ inputs.force-deploy }}
force-deploy-test: ${{ inputs.force-deploy-test }}
permissions:
contents: read
id-token: write
secrets:
NAIS_DOLLY_DEPLOY_API_KEY: ${{ secrets.NAIS_DOLLY_DEPLOY_API_KEY }}
NAIS_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }}
NAV_TOKEN: ${{ secrets.NAV_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
frontend:
needs: start
if: inputs.workflow == 'frontend'
uses: ./.github/workflows/common.workflow.frontend.yml
with:
cluster: ${{ inputs.cluster }}
working-directory: "${{ inputs.type }}/${{ inputs.name }}"
image-suffix: ${{ inputs.name }}
deploy-tag: ""
nais-manifest: ${{ inputs.nais-manifest }}
force-deploy: ${{ inputs.force-deploy }}
force-deploy-test: ${{ inputs.force-deploy-test }}
force-deploy-idporten: ${{ inputs.name == 'dolly-frontend' && inputs.force-deploy }}
force-deploy-unstable: ${{ inputs.name == 'dolly-frontend' && inputs.force-deploy-test }}
permissions:
contents: read
id-token: write
secrets:
NAIS_DOLLY_DEPLOY_API_KEY: ${{ secrets.NAIS_DOLLY_DEPLOY_API_KEY }}
NAIS_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }}
NAV_TOKEN: ${{ secrets.NAV_TOKEN }}
READER_TOKEN: ${{ secrets.READER_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}