Skip to content

Deploy alerts to NAIS prod [main] #8

Deploy alerts to NAIS prod [main]

Deploy alerts to NAIS prod [main] #8

Workflow file for this run

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