-
Notifications
You must be signed in to change notification settings - Fork 4
78 lines (67 loc) · 2.3 KB
/
deploy-qa.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
name: Deploy-QA
on:
workflow_run:
workflows: ["CI"]
branches: [development]
types: [completed]
workflow_dispatch:
inputs:
Name:
required: true
default: 'Re-run the workflow'
Description:
default: ''
jobs:
Deploy-QA:
runs-on: windows-latest
defaults:
run:
shell: bash
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'npm'
- name: Gatsby QA Cache
if: "!contains(github.event.head_commit.message, 'skip cache')"
id: gatsby-qa-cache
uses: actions/cache@v4
with:
path: |
public
.cache
key: ${{ runner.os }}-gatsby-qa-${{ github.run_id }}
restore-keys: ${{ runner.os }}-gatsby-qa-
- name: Install dependencies
run: npm ci --legacy-peer-deps
- name: Set user info
run: |
git config --local user.name 'github-actions[bot]'
git config --local user.email 'github-actions[bot]@users.noreply.github.com'
- name: Build
run: |
npm run build:qa
rm -f public/CNAME
env:
NODE_OPTIONS: "--max-old-space-size=8192"
EVENT_API_KEY_1: ${{ secrets.EVENT_API_KEY_1 }}
EVENT_API_KEY_2: ${{ secrets.EVENT_API_KEY_2 }}
EVENT_ORG_ID_1: ${{ secrets.EVENT_ORG_ID_1 }}
EVENT_ORG_ID_2: ${{ secrets.EVENT_ORG_ID_2 }}
GATSBY_GH_APP_GITALK_ID: ${{ secrets.GATSBY_GH_APP_GITALK_ID }}
GATSBY_GH_APP_GITALK_SECRET: ${{ secrets.GATSBY_GH_APP_GITALK_SECRET }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
GATSBY_ENV: ${{ secrets.GATSBY_ENV }}
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
personal_token: ${{ secrets.GH_TOKEN }}
external_repository: researchdata-sheffield/dataviz-hub2-qa
publish_branch: main
publish_dir: ./public
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'