Manual deploy to preprod [master] #585
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: Manual deploy | |
run-name: Manual deploy to ${{ inputs.environment }} [${{ github.ref_name }}] | |
on: | |
workflow_dispatch: | |
inputs: | |
environment: | |
description: 'Target environment' | |
required: true | |
default: 'preprod' | |
type: choice | |
options: | |
- preprod | |
- preprod-alt | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
jobs: | |
package-and-push-bygger: | |
name: 'Package bygger' | |
runs-on: ubuntu-latest-8-cores | |
permissions: | |
contents: 'read' | |
id-token: 'write' | |
packages: 'read' | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '20.9.0' | |
cache: 'yarn' | |
cache-dependency-path: '**/yarn.lock' | |
registry-url: https://npm.pkg.github.com/ | |
scope: '@navikt' | |
- name: 'Build application: Bygger' | |
env: | |
VITE_GIT_VERSION: ${{ github.sha }} | |
VITE_GIT_BRANCH: ${{ github.ref_name }} | |
run: yarn --frozen-lockfile && yarn build | |
- name: 'Build and push Docker image for bygger' | |
uses: nais/docker-build-push@v0 | |
id: docker-build-push-bygger | |
with: | |
team: skjemadigitalisering | |
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }} | |
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }} | |
image_suffix: bygger-${{ inputs.environment }} | |
build_args: | | |
git_sha=${{ github.sha }} | |
dockerfile: ./docker/Dockerfile.bygger | |
docker_context: ./packages | |
outputs: | |
image: ${{ steps.docker-build-push-bygger.outputs.image }} | |
deploy-bygger-to-preprod: | |
name: 'Deploy bygger to preprod' | |
needs: [package-and-push-bygger] | |
if: ${{ !failure() && !cancelled() }} | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: 'write' | |
steps: | |
- uses: 'actions/checkout@v4' | |
- name: 'Deploy to preprod' | |
uses: 'nais/deploy/actions/deploy@v2' | |
env: | |
CLUSTER: 'dev-gcp' | |
RESOURCE: './.nais/bygger/nais.yaml' | |
VARS: './.nais/bygger/${{ github.event.inputs.environment }}.yaml' | |
VAR: image=${{ needs.package-and-push-bygger.outputs.image }} | |
package-and-push-fyllut: | |
name: 'Package fyllut' | |
runs-on: ubuntu-latest-8-cores | |
permissions: | |
contents: 'read' | |
id-token: 'write' | |
packages: 'read' | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '20.9.0' | |
cache: 'yarn' | |
cache-dependency-path: '**/yarn.lock' | |
registry-url: https://npm.pkg.github.com/ | |
scope: '@navikt' | |
- name: 'Build application: Fyllut' | |
env: | |
VITE_GIT_VERSION: ${{ github.sha }} | |
VITE_GIT_BRANCH: ${{ github.ref_name }} | |
run: yarn --frozen-lockfile && yarn build | |
- name: 'Build and push Docker image for fyllut' | |
uses: nais/docker-build-push@v0 | |
id: docker-build-push-fyllut | |
with: | |
team: skjemadigitalisering | |
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }} | |
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }} | |
image_suffix: fyllut-${{ inputs.environment }} | |
dockerfile: ./docker/Dockerfile.fyllut-base | |
docker_context: ./packages | |
build_args: | | |
git_sha=${{ github.sha }} | |
pull: true | |
outputs: | |
image: ${{ steps.docker-build-push-fyllut.outputs.image }} | |
deploy-fyllut-to-preprod: | |
name: 'Deploy fyllut to preprod' | |
needs: [package-and-push-fyllut] | |
if: ${{ !failure() && !cancelled() }} | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: 'write' | |
steps: | |
- uses: 'actions/checkout@v4' | |
- name: 'Deploy to preprod' | |
uses: 'nais/deploy/actions/deploy@v2' | |
env: | |
CLUSTER: 'dev-gcp' | |
RESOURCE: './.nais/fyllut/config.yaml' | |
VARS: './.nais/fyllut/${{ github.event.inputs.environment }}.yaml' | |
VAR: image=${{ needs.package-and-push-fyllut.outputs.image }} |