Deploy-QA #175
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |