Deploy alerts to NAIS prod [main] #8
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: Deploy alerts to NAIS | |
run-name: Deploy alerts to NAIS ${{ github.event_name == 'push' && 'prod' || inputs.environment }} [${{ github.ref_name }}] | |
on: | |
workflow_dispatch: | |
inputs: | |
environment: | |
description: 'Environment to deploy alerts' | |
required: true | |
default: 'preprod' | |
type: choice | |
options: | |
- preprod | |
- prod | |
push: | |
branches: | |
- 'main' | |
paths: | |
- '.nais/alerts.yml' | |
- '.github/workflows/alert-deploy.yml' | |
jobs: | |
apply-alerts-prod: | |
name: Apply alerts to prod | |
if: (github.event_name == 'push' && github.ref_name == 'main') || inputs.environment == 'prod' | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: deploy to prod | |
uses: nais/deploy/actions/deploy@v2 | |
env: | |
CLUSTER: prod-gcp | |
RESOURCE: .nais/alerts.yml | |
apply-alerts-dev: | |
name: Apply alerts to dev | |
if: inputs.environment == 'preprod' | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: deploy to dev | |
uses: nais/deploy/actions/deploy@v2 | |
env: | |
CLUSTER: dev-gcp | |
RESOURCE: .nais/alerts-preprod.yml |