Skip to content

Manual preprod deploy of branch dependabot/maven/graphql-kotlin.version-7.0.1 #174

Manual preprod deploy of branch dependabot/maven/graphql-kotlin.version-7.0.1

Manual preprod deploy of branch dependabot/maven/graphql-kotlin.version-7.0.1 #174

Workflow file for this run

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
- loadtests
- prod
jobs:
build-and-push:
permissions:
contents: "read"
id-token: "write"
name: Build and push Docker container
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17.x'
cache: 'maven'
- name: set timezone
uses: szenius/[email protected]
with:
timezoneLinux: "Europe/Oslo"
- 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: team-soknad
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:
name: Deploy to preprod
needs: build-and-push
if: github.event.inputs.environment == 'preprod'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: nais/deploy/actions/deploy@v1
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: dev-gcp
RESOURCE: .nais/nais.yml
VARS: .nais/config-preprod.json
VAR: image=${{ needs.build-and-push.outputs.image }}
deploy-loadtests:
name: Deploy to preprod loadtests
needs: build-and-push
if: github.event.inputs.environment == 'loadtests'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: nais/deploy/actions/deploy@v1
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: dev-gcp
RESOURCE: .nais/nais.yml
VARS: .nais/config-loadtests.json
VAR: image=${{ needs.build-and-push.outputs.image }}
deploy-prod:
name: Deploy to prod
needs: build-and-push
if: github.event.inputs.environment == 'prod'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: nais/deploy/actions/deploy@v1
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: prod-gcp
RESOURCE: .nais/nais.yml
VARS: .nais/config-prod.json
VAR: image=${{ needs.build-and-push.outputs.image }}
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@v3
- 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@v3
- 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