-
Notifications
You must be signed in to change notification settings - Fork 16
74 lines (71 loc) · 2.34 KB
/
azure-static-web-apps-icy-meadow-0fc35e30f.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
name: Staging Environment App CI/CD and Deploy
on:
push:
branches:
- develop
pull_request:
types: [opened, synchronize, reopened, closed]
branches:
- develop
jobs:
build_and_deploy_job:
permissions:
pull-requests: write
environment: staging
if:
github.event_name == 'push' || (github.event_name == 'pull_request' &&
github.event.action != 'closed')
runs-on: ubuntu-latest
name: Build and Deploy Job
env:
REACT_APP_API_ROOT: ${{ secrets.API_ROOT }}
REACT_APP_IMAGE_API_ROOT: ${{ secrets.IMAGE_API_ROOT }}
REACT_APP_AZMAPS_CLIENT_ID: ${{ secrets.AZMAPS_CLIENT_ID }}
REACT_APP_ONEDS_TENANT_KEY: ${{ secrets.ONEDS_TENANT_KEY }}
REACT_APP_HUB_URL: ${{ secrets.HUB_URL }}
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions/cache@v3
id: npm-cache
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
- name: Build docs and metadata
run: ./scripts/update
- name: Test and lint
run: ./scripts/test
- name: Inject disallow crawling for robots.txt
run: |
echo -e "User-agent: *\nDisallow: /\n" > public/robots.txt
- name: Build optimized bundle
id: build-bundle
run: ./scripts/cibuild
- name: Deploy (Staging)
id: builddeploy-staging
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token:
${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_ICY_MEADOW_0FC35E30F }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
skip_deploy_on_missing_secrets: true
action: "upload"
skip_app_build: true
app_location: "build"
api_location: "api"
output_location: ""
close_pull_request_job:
if: github.event_name == 'pull_request' && github.event.action == 'closed'
runs-on: ubuntu-latest
name: Close Pull Request Job
steps:
- name: Close Pull Request (Staging)
id: closepullrequest-staging
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token:
${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_ICY_MEADOW_0FC35E30F }}
action: "close"