Skip to content

Deploy to environment #200

Deploy to environment

Deploy to environment #200

name: Deploy to environment
on:
workflow_call:
inputs:
environment:
type: string
workflow_dispatch:
inputs:
environment:
type: choice
description: "Environment to deploy to"
options:
- test
- staging
- production
- yt01
- at21
- at22
- at23
- at24
jobs:
get-version:
name: Get version
runs-on: ubuntu-latest
outputs:
imageTag: ${{ steps.get-version.outputs.imageTag }}
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: "Get current version"
uses: ./.github/actions/get-current-version
id: get-version
publish:
name: Publish
runs-on: ubuntu-latest
needs: [get-version]
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v4
- name: "Publish image"
uses: ./.github/actions/publish-image
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
dockerImageBaseName: ghcr.io/altinn/altinn-correspondence
imageTag: ${{ needs.get-version.outputs.imageTag }}
deploy:
name: Deploy
runs-on: ubuntu-latest
needs: [get-version]
environment: ${{ inputs.environment }}
permissions:
id-token: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Deploy to environment
uses: ./.github/actions/deploy-to-environment
with:
environment: ${{ inputs.environment }}
imageTag: ${{ needs.get-version.outputs.imageTag }}
ACCESS_MANAGEMENT_SUBSCRIPTION_KEY: ${{ secrets.ACCESS_MANAGEMENT_SUBSCRIPTION_KEY }}
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_ENVIRONMENT_KEY_VAULT_NAME: ${{ secrets.AZURE_ENVIRONMENT_KEY_VAULT_NAME }}
AZURE_NAME_PREFIX: ${{ secrets.AZURE_NAME_PREFIX }}
AZURE_STORAGE_ACCOUNT_NAME: ${{ secrets.AZURE_STORAGE_ACCOUNT_NAME }}
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_TEST_ACCESS_CLIENT_ID: ${{ secrets.AZURE_TEST_ACCESS_CLIENT_ID }}
CORRESPONDENCE_BASE_URL: ${{ secrets.CORRESPONDENCE_BASE_URL }}
CONTACT_RESERVATION_REGISTRY_BASE_URL: ${{ secrets.CONTACT_RESERVATION_REGISTRY_BASE_URL }}
DIALOGPORTEN_ISSUER: ${{ secrets.DIALOGPORTEN_ISSUER }}
IDPORTEN_CLIENT_ID: ${{ secrets.IDPORTEN_CLIENT_ID }}
IDPORTEN_CLIENT_SECRET: ${{ secrets.IDPORTEN_CLIENT_SECRET }}
IDPORTEN_ISSUER: ${{ secrets.IDPORTEN_ISSUER }}
MASKINPORTEN_CLIENT_ID: ${{ secrets.MASKINPORTEN_CLIENT_ID }}
MASKINPORTEN_JWK: ${{ secrets.MASKINPORTEN_JWK }}
PLATFORM_BASE_URL: ${{ secrets.PLATFORM_BASE_URL }}
PLATFORM_SUBSCRIPTION_KEY: ${{ secrets.PLATFORM_SUBSCRIPTION_KEY }}
SLACK_URL: ${{ secrets.SLACK_URL }}
SBL_BRIDGE_BASE_URL: ${{ secrets.SBL_BRIDGE_BASE_URL }}
MASKINPORTEN_TOKEN_EXCHANGE_ENVIRONMENT: ${{ secrets.MASKINPORTEN_TOKEN_EXCHANGE_ENVIRONMENT }}