Refactor GitHub Actions workflow for deployment

This commit is contained in:
SMGoro
2025-10-21 09:32:09 +08:00
committed by GitHub
parent 249d7ee80d
commit a082a6ff32

View File

@@ -13,36 +13,41 @@ permissions:
jobs:
build:
runs-on: ubuntu-latest
outputs:
build-path: dist
steps:
- name: Checkout
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 8
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 24
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Build
- name: Build project
run: pnpm run build-nocdn
- name: Upload artifact
- name: Upload GitHub Pages artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload dist repository
path: './dist'
name: gh-pages
path: ./dist
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4