Skip to content

Build and Deploy

Build and Deploy #285

name: Build and Deploy
on:
schedule:
# Run daily at 00:00 UTC
- cron: '0 0 * * *'
push:
branches: [ main ]
workflow_dispatch:
permissions:
contents: write
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
run: npm install
- name: Fetch team work
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npm run fetch
continue-on-error: true
- name: Build site
run: npm run build
- name: Deploy to gh-pages branch
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
# Removed force_orphan to preserve existing files like CNAME