Skip to content

Fix #4

Fix #4 #32

name: Deploy frontend to GitHub Pages
on:
workflow_dispatch:
push:
branches:
- main
paths:
- 'frontend/**'
jobs:
build-deploy:
runs-on: ubuntu-latest
defaults:
run:
working-directory: frontend
steps:
# Checkout repository
- name: Checkout repository
uses: actions/checkout@v4
# Setup Node.js
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: latest
# Enable Corepack
- name: Enable Corepack
run: corepack enable
# Install Yarn V4
- name: Install Yarn v4
run: |
corepack prepare yarn@stable --activate
yarn --version
# Install Dependencies
- name: Install dependencies
run: yarn install
# Build project
- name: Build project
run: yarn build
# Create 404.html
- name: Create 404.html
run: cp ./dist/index.html ./dist/404.html
# Deploy to GitHub Pages
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: frontend/dist