Skip to content

ci: Deploy to GH Pages only from main branch #5

ci: Deploy to GH Pages only from main branch

ci: Deploy to GH Pages only from main branch #5

Workflow file for this run

name: gh-pages
on:
# Runs on pushes targeting the default branch
push:
branches: ["master", "main"]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: 20.x
- name: Build
run: |
npm i
npm run build
- name: Deploy to GitHub Pages
if: success()
uses: crazy-max/ghaction-github-pages@v2
with:
target_branch: gh-pages
build_dir: build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}