-
Notifications
You must be signed in to change notification settings - Fork 3
48 lines (40 loc) · 1.7 KB
/
prod_fe_build_and_deploy.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
name: Production Frontend Build and Deploy
on:
workflow_dispatch:
env:
WORKING_DIR: "frontend"
DOCKER_FILE: "Dockerfile.azure"
ENVIRONMENT: prod
DOMAIN_NAME: "ops.opre.acf.gov"
jobs:
build-frontend:
permissions:
contents: read
packages: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.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.DOMAIN_NAME }}, MODE=production"
deploy-frontend:
needs: build-frontend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Log in to Azure
uses: azure/login@a65d910e8af852a8061c627c456678983e180302 # v2.2.0
with:
creds: ${{ secrets.PROD_AZURE_CREDS }}
- name: Deploy Container App
uses: azure/container-apps-deploy-action@5f5f4c56ca90376e3cfbd76ba8fe8533c784e655 # 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 }}:${{ github.sha }}