-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (72 loc) · 1.82 KB
/
deploy-webapp.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: Deploy WebApp
on:
push:
paths:
- webApp/**
- .github/workflows/**
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use NodeJS 20
uses: actions/setup-node@v3
with:
node-version: 20.x
- name: Resotre
run: npm install
working-directory: webApp
- name: Build
run: npm run release
working-directory: webApp
- name: Test
run: npm run test
working-directory: webApp
- name: Upload Artifact
uses: actions/upload-pages-artifact@v2
with:
# Path of the directory containing the static assets.
path: webApp/build
retention-days: 3
release:
needs: build
name: Deploy to GitHub Pages (Release)
runs-on: ubuntu-latest
if: github.ref_name == 'dev'
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy
id: deployment
uses: actions/deploy-pages@v2
test-env:
needs: build
name: Deploy to Test Environment
runs-on: ubuntu-latest
if: github.ref_name != 'dev'
environment:
name: test-environment
url: https://billpathwebapptest.z6.web.core.windows.net/
steps:
- name: Download Artifact
uses: actions/download-artifact@v2
with:
name: github-pages
- name: Extract Artifact
run: |
mkdir billpath
tar --extract --file artifact.tar --directory billpath
- name: Deploy
uses: bacongobbler/azure-blob-storage-upload@main
with:
source_dir: billpath
account_name: billpathwebapptest
container_name: $web
sas_token: ${{ secrets.AZURE_STORAGE_SAS_TOKEN }}
sync: true