-
Notifications
You must be signed in to change notification settings - Fork 0
100 lines (86 loc) · 2.91 KB
/
release_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
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
89
90
91
92
93
94
95
96
97
98
99
100
# TODO: Skip the local build by using skip_app_build. Use an artifact instead
# TODO: yarn install --frozen-lockfile --ignore-scripts to skip postinstall
# TODO: use app_build_command to create a custom build script
name: Release Frontend
on:
push:
branches:
- main
paths-ignore:
- "api/**"
jobs:
staging_deployment:
environment:
name: Staging
url: https://staging.fencing.club
runs-on: ubuntu-latest
name: Deploy to Staging
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Get Yarn Cache
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache Dependencies
id: deps-cache
uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install Dependencies
run: yarn install --frozen-lockfile --prefer-offline --ignore-scripts
- name: Build Frontend
run: yarn build:web --mode staging
- name: Deploy Frontend
id: deploystaging
uses: Azure/static-web-apps-deploy@v1
with:
production_branch: "main"
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_BRAVE_COAST_047525A1E }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
action: "upload"
app_location: "/dist"
api_location: ""
output_location: "/dist"
skip_app_build: true
production_deployment:
environment:
name: Production
url: https://fencing.club
needs: staging_deployment
runs-on: ubuntu-latest
name: Deploy to Production
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Get Yarn Cache
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache Dependencies
id: deps-cache
uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install Dependencies
run: yarn install --frozen-lockfile --prefer-offline --ignore-scripts
- name: Build Frontend
run: yarn build:web --mode production
- name: Deploy Frontend
id: deployproduction
uses: Azure/static-web-apps-deploy@v1
with:
production_branch: "main"
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_PURPLE_BEACH_056E5171E }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
action: "upload"
app_location: "/dist"
api_location: ""
output_location: "/dist"
skip_app_build: true