Skip to content

Dev to Main (#154) #350

Dev to Main (#154)

Dev to Main (#154) #350

Workflow file for this run

name: Deploy to GitHub Pages
on:
pull_request:
branches: [main, dev]
push:
branches: [main, dev]
jobs:
test-deploy:
if: github.event_name != 'push'
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Test build website
run: yarn build
deploy:
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn
- uses: webfactory/ssh-agent@v0.5.0
with:
ssh-private-key: ${{ secrets.CARD_PRESENT_PRIVATE_KEY }}
if: github.ref == 'refs/heads/main'
- uses: webfactory/ssh-agent@v0.5.0
with:
ssh-private-key: ${{ secrets.CARD_PRESENT_DEV_PRIVATE_KEY }}
if: github.ref == 'refs/heads/dev'
- name: Deploy to GitHub Pages
env:
USE_SSH: true
run: |
git config --global user.email "actions@github.com"
git config --global user.name "gh-actions"
chmod +x ./setenv.sh
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
echo "Deploying to production"
./setenv.sh prod
else
echo "Deploying to staging"
./setenv.sh dev
fi
cat docusaurus.config.js
yarn install --frozen-lockfile
yarn deploy