Skip to content

Add GH Pages

Add GH Pages #1

name: Deploy gh-pages
on:
push:
branches:
- main
pull_request: # ! remove before merge
branches: [main] # ! remove before merge
jobs:
build:
name: Build artifact
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Setup Node.js 20
uses: actions/setup-node@v3
with:
node-version: 20
- name: Install Dependencies
run: yarn
- name: Build project
run: yarn build
- name: Upload production-ready build files
uses: actions/upload-artifact@v3
with:
name: production-files
path: ./dist
deploy:
name: Deploy artifact
needs: build
runs-on: ubuntu-latest
# if: github.ref == 'refs/heads/main' # ! enable before merge
steps:
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: production-files
path: ./dist
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist