Skip to content

[pre-commit.ci] pre-commit autoupdate (#34) #37

[pre-commit.ci] pre-commit autoupdate (#34)

[pre-commit.ci] pre-commit autoupdate (#34) #37

Workflow file for this run

# https://squidfunk.github.io/mkdocs-material/publishing-your-site/#with-github-actions
# https://www.mkdocs.org/user-guide/deploying-your-docs/#other-providers
# https://github.com/actions/starter-workflows/blob/main/pages/
name: build
on:
push:
branches:
- main
paths-ignore:
- '.vscode/**'
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
compile-bot:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
repository: Scholar-Compass/Scholar-Compass-front
ref: embed
- uses: pnpm/action-setup@v3
with:
version: 8
- uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
cache-dependency-path: pnpm-lock.yaml
- run: pnpm install
- run: VITE_PUBLIC_API_END_POINT=https://api.scholarcompass.org pnpm build
- name: Rename to bot.js
run: |
cd out && mv $(jq '.["src/main.tsx"].file' .vite/manifest.json --raw-output) ../bot.js
- name: Upload bot.js
uses: actions/upload-artifact@v4
with:
name: bot.js
path: bot.js
build:
runs-on: ubuntu-latest
needs: compile-bot
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # mkdocs-git-* plugins need all history
- uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: pip
cache-dependency-path: |
justfile
mkdocs.yml
- uses: taiki-e/install-action@v2
with:
tool: just
- run: just bootstrap
- name: Download bot.js
uses: actions/download-artifact@v4
with:
name: bot.js
path: docs/asset
- run: MKDOCS_ENABLE_GIT_INTEGRATION=true MKDOCS_BOT=production just build
- uses: actions/upload-pages-artifact@v3
with:
path: site/
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/deploy-pages@v4
id: deployment