-
Notifications
You must be signed in to change notification settings - Fork 9
62 lines (53 loc) · 2.27 KB
/
dev_fe_build_and_deploy.yml
File metadata and controls
62 lines (53 loc) · 2.27 KB
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
name: Dev Frontend Build and Deploy
on:
workflow_dispatch:
push:
branches:
- 'main'
paths:
- 'frontend/**'
env:
WORKING_DIR: "frontend"
DOCKER_FILE: "Dockerfile.azure"
ENVIRONMENT: dev
DOMAIN_NAME: "ops.opre.acf.gov"
jobs:
build-frontend:
permissions:
contents: read
packages: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Build and publish the Docker image for ${{ github.repository }}
uses: ./.github/actions/build-and-push
with:
image_name: ${{ github.repository }}/ops-${{ env.WORKING_DIR }} # it will be lowercased internally
github_token: ${{ secrets.GITHUB_TOKEN }}
context: ${{ github.workspace }}/${{ env.WORKING_DIR }}
dockerfile: ${{ github.workspace }}/${{ env.WORKING_DIR }}/${{ env.DOCKER_FILE }}
image_tags: "${{ github.sha }},${{ env.ENVIRONMENT }}"
build_args: "VITE_BACKEND_DOMAIN=https://${{ env.ENVIRONMENT }}.${{ env.DOMAIN_NAME }}, MODE=${{ env.ENVIRONMENT }}, VITE_ENABLE_MSW=false, BUILD_STORYBOOK=true"
deploy-frontend:
needs: build-frontend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Update yaml file to provide revision suffix
uses: fjogeleit/yaml-update-action@04ff6ec06568fd21197db746472e36cc425de850 # v0.16.1
with:
valueFile: './.github/container-app-suffixes.yml'
propertyPath: 'template.revisionSuffix'
value: ${{ github.run_id }}-${{ github.run_number }}
commitChange: false
- name: Log in to Azure
uses: azure/login@532459ea530d8321f2fb9bb10d1e0bcf23869a43 # v3.0.0
with:
creds: ${{ secrets.SDLC_AZURE_CREDS }}
- name: Deploy Container App
uses: azure/container-apps-deploy-action@8dff69dac3367c32ceb2690d8f13adbeab462703 # v2
with:
containerAppName: opre-ops-${{ env.ENVIRONMENT }}-app-${{ env.WORKING_DIR }}
resourceGroup: opre-ops-${{ env.ENVIRONMENT }}-app-rg
imageToDeploy: ghcr.io/hhs/opre-ops/ops-${{ env.WORKING_DIR }}:${{ env.ENVIRONMENT }}
yamlConfigPath: ./.github/container-app-suffixes.yml