Skip to content

Deploy

Deploy #62

Workflow file for this run

name: Deploy
on:
workflow_run:
workflows: ["Update DB"]
types: [completed]
push:
branches: [ main ]
workflow_dispatch:
permissions:
contents: write
concurrency:
group: gh-pages
cancel-in-progress: true
jobs:
deploy:
if: |
github.event_name != 'workflow_run' ||
github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
steps:
- name: Checkout main
uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install dependencies
run: npm ci
- name: Build project
run: npm run build
- name: Ensure DB is in dist
run: |
test -f ./public/CollecTF.db.gz
cp ./public/CollecTF.db.gz ./dist/CollecTF.db.gz
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist