-
Notifications
You must be signed in to change notification settings - Fork 56
86 lines (70 loc) · 2.42 KB
/
deploy-live.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
name: Deploy Live
on:
push:
branches: [ master ]
workflow_dispatch:
jobs:
build:
if: github.repository_owner == 'PaloAltoNetworks'
name: Build
runs-on: pan-dev-runner-xl
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'yarn'
- name: Get yarn cache
id: yarn-cache
run: echo "YARN_CACHE_DIR=$(yarn cache dir)" >> "${GITHUB_OUTPUT}"
- name: Cache dependencies
uses: actions/cache@v4
with:
path: ${{ steps.yarn-cache.outputs.YARN_CACHE_DIR }}
key: ${{ runner.os }}-pandev-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-pandev-
- name: Cache docusaurus build
uses: actions/cache@v4
with:
path: node_modules/.cache/webpack
key: pandev-live-${{ github.run_id }}
restore-keys: |
pandev-live
- name: Install dependencies
run: yarn --prefer-offline
- name: Build site
run: REACT_APP_ERROR_REPORTER_APIKEY=${{ secrets.ERROR_REPORTER_APIKEY }} REACT_APP_FIREBASE_APIKEY=${{ secrets.FIREBASE_APIKEY }} REACT_APP_RECAPTCHA_APIKEY=${{ secrets.RECAPTCHA_APIKEY }} yarn build-github && zip -r build.zip build
- uses: actions/upload-artifact@v4
with:
name: build
path: build.zip
deploy:
name: Deploy
needs: build
runs-on: pan-dev-runner-lg
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'yarn'
- uses: actions/download-artifact@v4
with:
name: build
- name: Unzip build artifact
run: unzip build.zip
- name: Deploy to Firebase
id: deploy_live
uses: FirebaseExtended/action-hosting-deploy@120e124148ab7016bec2374e5050f15051255ba2 # v0.7.1
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_PAN_DEV_F1B58 }}'
projectId: pan-dev-f1b58
channelId: live
env:
FIREBASE_CLI_PREVIEWS: hostingchannels