Skip to content

Merge pull request #23 from Brian-Pho/dependabot/npm_and_yarn/gatsby-… #97

Merge pull request #23 from Brian-Pho/dependabot/npm_and_yarn/gatsby-…

Merge pull request #23 from Brian-Pho/dependabot/npm_and_yarn/gatsby-… #97

Workflow file for this run

name: Deploy Gatsby site to Github Pages
on:
# Runs on pushes targeting the default branch
push:
branches:
- master
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
# Default to bash
defaults:
run:
shell: bash
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm ci --legacy-peer-deps
- name: Install Gatsby CLI
run: npm install -g gatsby-cli --legacy-peer-deps
- name: Build
run: gatsby build --prefix-paths
- name: Verify build
run: ls -la public
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.ref == 'refs/heads/master' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages