Merge pull request #128 from jerboa88/v3 #5
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: Gatsby Build & Deploy | |
on: | |
pull_request: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
cache: yarn | |
- name: Install dependencies | |
run: yarn install --immutable | |
- name: Build with Gatsby | |
env: | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
run: yarn build | |
- name: Deploy to gh-pages branch | |
uses: peaceiris/actions-gh-pages@v4 | |
if: ${{ github.ref == 'refs/heads/main' }} | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./public | |
cname: johng.io |