Skip to content

Build and deploy GH Pages #632

Build and deploy GH Pages

Build and deploy GH Pages #632

Workflow file for this run

# On every push this script is executed
on:
workflow_dispatch:
push:
branches:
- main
schedule:
- cron: "0 10 * * *"
concurrency: build
name: Build and deploy GH Pages
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "lts/*"
cache: "npm"
- name: Setup Pages
id: setup-pages
uses: actions/configure-pages@v5
- name: Install deps
run: |
npm install
- name: Build site
run: |
npm run build -- --no-lint
cp public/sitemap*.xml out/
cp public/robots.txt out/
cp -r public/data/ out/data/
env:
NEXT_PUBLIC_BASE_PATH: ${{ steps.setup-pages.outputs.base_path }}
NEXT_PUBLIC_ASSET_PATH: ${{ steps.setup-pages.outputs.base_url }}
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ${{ github.workspace }}/out/
deploy:
needs: build
concurrency: dashboard-publish
permissions:
pages: write
id-token: write
actions: read
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4