Skip to content

feat: Make GitHub Pages deployment dynamic #486

feat: Make GitHub Pages deployment dynamic

feat: Make GitHub Pages deployment dynamic #486

Workflow file for this run

# .github/workflows/deploy.yml
name: GitHub Pages
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
defaults:
run:
working-directory: ./
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'npm'
- name: Get yarn cache
id: yarn-cache
run: echo "dir=$(yarn cache dir)" >> "$GITHUB_OUTPUT"
- name: Cache dependencies
uses: actions/cache@v4
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-website-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-website-
- run: yarn install --frozen-lockfile
- run: yarn build
env:
CI: false
- name: Deploy
uses: peaceiris/actions-gh-pages@v4
if: ${{ github.ref == 'refs/heads/main' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build
cname: ${{ github.ref == 'refs/heads/main' && vars.CNAME_DOMAIN || '' }}