Merge Goal run: 全站改进 P0-P3(CTA 修复、ossheroes 暗黑化、官网工程优化、仓库卫生) #123
This file contains hidden or 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 | |
| workflow_run: | |
| workflows: ["Monthly Script Runner"] | |
| types: | |
| - completed | |
| jobs: | |
| build-deploy: | |
| permissions: | |
| contents: write | |
| runs-on: ubuntu-latest | |
| if: "!contains(github.event.head_commit.message, 'skip ci')" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # required so the deploy action can push | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'pnpm' | |
| cache-dependency-path: | | |
| pnpm-lock.yaml | |
| ossheroes/pnpm-lock.yaml | |
| - name: Build main site | |
| run: | | |
| pnpm install --frozen-lockfile | |
| pnpm run build | |
| - name: Build ossheroes site | |
| run: | | |
| if [ ! -d ossheroes ]; then | |
| echo "Error: ossheroes directory not found" | |
| exit 1 | |
| fi | |
| cd ossheroes | |
| pnpm install --frozen-lockfile | |
| pnpm run build | |
| if [ ! -d public ]; then | |
| echo "Error: ossheroes/public directory not created" | |
| exit 1 | |
| fi | |
| cp -r public ../dist/ossheroes | |
| - name: Deploy 🚀 | |
| uses: JamesIves/github-pages-deploy-action@v4 | |
| with: | |
| branch: gh-pages | |
| folder: dist |