-
Notifications
You must be signed in to change notification settings - Fork 1
67 lines (60 loc) · 2.26 KB
/
deploy-dashboard.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Deploy Dashboard
on:
workflow_dispatch:
inputs:
environment:
type: choice
description: "Environment to deploy to"
options:
- test
- staging
- production
- yt01
- at21
- at22
- at23
- at24
permissions:
id-token: write
contents: read
packages: write
jobs:
build-and-deploy:
runs-on: ubuntu-latest
environment: ${{ github.event.inputs.environment }}
steps:
- uses: actions/checkout@v4
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push image to registry
shell: bash
run: |
# Construct the image tag using the Git hash
IMAGE=ghcr.io/altinn/altinn-correspondence/altinn-correspondence-dashboard:${{ github.sha }}
docker build -f tools/Altinn.Correspondence.Dashboard/Dockerfile . --tag $IMAGE
docker push $IMAGE
- name: Azure Login
uses: azure/login@v1
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: Deploy Bicep
uses: azure/arm-deploy@v1
env:
AZURE_NAME_PREFIX: ${{ secrets.AZURE_NAME_PREFIX }}
containerImage: ghcr.io/altinn/altinn-correspondence/altinn-correspondence-dashboard:${{ github.sha }}
AZURE_ENVIRONMENT_KEY_VAULT_NAME: ${{ secrets.AZURE_ENVIRONMENT_KEY_VAULT_NAME }}
AZURE_APP_REGISTRATION_ID: ${{ secrets.AZURE_APP_REGISTRATION_ID }}
AZURE_APP_REGISTRATION_CLIENT_SECRET: ${{ secrets.AZURE_APP_REGISTRATION_CLIENT_SECRET }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
DASHBOARD_ALLOWED_GROUP_ID: ${{ secrets.AZURE_TEST_ACCESS_CLIENT_ID }}
with:
scope: resourcegroup
resourceGroupName: ${{ secrets.AZURE_NAME_PREFIX }}-rg
template: .azure/applications/dashboard/main.bicep
parameters: .azure/applications/dashboard/main.bicepparam