generated from CDCgov/template
-
Notifications
You must be signed in to change notification settings - Fork 3
70 lines (66 loc) · 2.06 KB
/
build-deploy-frontend.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
68
69
70
name: Build and Deploy Frontend
on:
push:
branches: test-deploy-middleware
# workflow_dispatch:
# inputs:
# deploy-env:
# description: 'The environment to deploy to'
# required: true
# type: choice
# options:
# - dev
# - demo
# storage-account-name:
# description: 'After the demo env gets created, copy its blob storage name here'
# required: false
permissions:
id-token: write
contents: read
jobs:
build-frontend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/build-frontend
name: Build frontend
with:
api-endpoint: https://reportvision-middleware-demo.azurewebsites.net/
frontend-tarball: ./frontend.tgz
frontend-path: ./frontend
frontend-build-path: ./frontend/dist/
node-version: 20
deploy-with-blob-name-optional:
name: Deploy
runs-on: ubuntu-latest
environment: demo
needs: [build-frontend]
steps:
- name: Download Artifacts To Job
uses: actions/download-artifact@v4
with:
name: frontend-tarball
- name: Unpack client
shell: bash
run: |
mkdir frontend-deploy;
tar -C frontend-deploy -zxvf frontend.tgz
- name: Azure login
uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
object-id: ${{ secrets.AZURE_OBJECT_ID }}
- name: Upload to Azure blob storage
shell: bash
run: |
if [ -z "75fcytiuc71jefqdbd3jzpci" ]; then
az storage blob upload-batch --account-name reportvisionfrontenddemo -d '$web' -s frontend-deploy/ --overwrite
else
az storage blob upload-batch --account-name 75fcytiuc71jefqdbd3jzpci -d '$web' -s frontend-deploy/ --overwrite
fi
- name: Azure logout
shell: bash
run: |
az logout