Skip to content

Deploy to GitHub Pages #30

Deploy to GitHub Pages

Deploy to GitHub Pages #30

Workflow file for this run

name: πŸš€ Deploy to GitHub Pages
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: write
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: πŸ“₯ Checkout repository
uses: actions/checkout@v3
- name: πŸ—οΈ Install Node.js
uses: actions/setup-node@v3
with:
node-version: "18"
cache: "npm"
- name: πŸ“¦ Install PNPM (direct binary)
run: |
curl -fsSL https://get.pnpm.io/install.sh | sh -
- name: βž• Add PNPM to PATH
run: echo "~/.local/share/pnpm" >> $GITHUB_PATH
- name: πŸ“¦ Install dependencies
run: pnpm install
- name: πŸ§ͺ Run Tests
run: pnpm test
deploy:
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
needs: build-and-test
runs-on: ubuntu-latest
steps:
- name: πŸ“₯ Checkout repository
uses: actions/checkout@v3
- name: πŸ—οΈ Install Node.js
uses: actions/setup-node@v3
with:
node-version: "18"
cache: "npm"
- name: πŸ“¦ Install PNPM (direct binary)
run: |
curl -fsSL https://get.pnpm.io/install.sh | sh -
- name: βž• Add PNPM to PATH
run: echo "~/.local/share/pnpm" >> $GITHUB_PATH
- name: πŸ“¦ Install dependencies
run: pnpm install
- name: πŸ—‚οΈ Copy _redirects file
run: cp public/_redirects docs/_redirects || echo "No _redirects found"
- name: πŸ”¨ Build project
run: pnpm run build
- name: πŸš€ Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
keep_files: true