Manual preprod deploy of branch dependabot/maven/all-minor-patch-0108c21d5e #456
Workflow file for this run
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: Manually triggered deployment | |
run-name: Manual ${{ github.event.inputs.environment }} deploy of branch ${{ github.head_ref || github.ref_name }} | |
on: | |
workflow_dispatch: | |
inputs: | |
environment: | |
description: 'Environment to deploy' | |
required: true | |
default: 'preprod' | |
type: choice | |
options: | |
- none | |
- preprod | |
- prod | |
jobs: | |
build-and-push: | |
permissions: | |
contents: "read" | |
id-token: "write" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set timezone | |
uses: szenius/[email protected] | |
with: | |
timezoneLinux: "Europe/Oslo" | |
- name: Set up JDK | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: 21 | |
cache: 'maven' | |
- name: Build with maven | |
run: mvn install --file pom.xml | |
- name: Build and push Docker image | |
uses: nais/docker-build-push@v0 | |
id: docker-build-push | |
with: | |
team: teamserviceklage | |
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }} | |
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }} | |
image_suffix: ${{ github.event.inputs.environment }} | |
byosbom: target/bom.json | |
outputs: | |
image: ${{ steps.docker-build-push.outputs.image }} | |
deploy-preprod: | |
needs: [build-and-push] | |
if: github.event.inputs.environment == 'preprod' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: nais/deploy/actions/deploy@v1 | |
env: | |
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }} | |
CLUSTER: dev-gcp | |
RESOURCE: .nais/nais.yml | |
VARS: .nais/preprod-config.json | |
VAR: image=${{needs.build-and-push.outputs.image}} | |
DRY_RUN: false | |
deploy-prod: | |
needs: [build-and-push] | |
if: github.event.inputs.environment == 'prod' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: nais/deploy/actions/deploy@v1 | |
env: | |
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }} | |
CLUSTER: prod-gcp | |
RESOURCE: .nais/nais.yml | |
VAR: image=${{needs.build-and-push.outputs.image}} | |
VARS: .nais/p-config.json | |
DRY_RUN: false | |
deploy-alerts-preprod: | |
if: github.event.inputs.environment == 'preprod' | |
needs: [deploy-preprod] | |
name: Deploy alerts to dev | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Deploy to dev | |
uses: nais/deploy/actions/deploy@v1 | |
env: | |
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }} | |
CLUSTER: dev-gcp | |
RESOURCE: .nais/alerts.yml | |
VARS: .nais/preprod-alert.json | |
deploy-alerts-prod: | |
if: github.event.inputs.environment == 'prod' | |
needs: [deploy-prod] | |
name: Deploy alerts to prod | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Deploy to dev | |
uses: nais/deploy/actions/deploy@v1 | |
env: | |
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }} | |
CLUSTER: prod-gcp | |
RESOURCE: .nais/alerts.yml | |
VARS: .nais/prod-alert.json |