[non-related] build: Upgrade dependencies #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy to Github Pages | |
on: | |
push: | |
branches: [ main, opt/ci ] | |
jobs: | |
setup: | |
name: Setup Project Info | |
runs-on: ubuntu-latest | |
outputs: | |
DIST_NAME: ${{ steps.get-info.outputs.DIST_NAME }} | |
steps: | |
- name: 🧐 Checkout | |
id: checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: '0' | |
- name: 📙 Get Build Information | |
id: get-info | |
run: | | |
COMMIT_COUNT=$(git rev-list --count HEAD) | |
BUILD_DATE=$(date "+%y%m%d") | |
HEAD_SHA=$(git rev-parse --short HEAD) | |
echo "DIST_NAME=dist-${COMMIT_COUNT}-${BUILD_DATE}-${HEAD_SHA}" >> $GITHUB_OUTPUT | |
main: | |
name: Build Production Pages | |
runs-on: ubuntu-latest | |
needs: setup | |
env: | |
DIST_NAME: ${{ needs.setup.outputs.DIST_NAME }} | |
steps: | |
- name: 🧐 Checkout | |
id: checkout | |
uses: actions/checkout@v4 | |
- name: 🔧 Setup pnpm | |
id: setup_pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: latest | |
- name: 🚧 Setup dependencies | |
id: setup_deps | |
run: | | |
pnpm install | |
- name: 📦 Build production pages | |
id: build | |
run: | | |
mv docs/.vitepress/config.ts docs/.vitepress/config.ts.bak | |
mv docs/.vitepress/config.pages.ts docs/.vitepress/config.ts | |
pnpm run build | |
cp docs/assets/logo.png dist/assets/ | |
- name: 🌐 Upload the build | |
id: upload | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.DIST_NAME }} | |
path: dist | |
- name: 🚀 Deploy to Github Pages | |
id: deploy | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
folder: dist | |
branch: gh-pages | |
token: ${{ secrets.DEPLOY_TOKEN }} |