add pnpm-lock.yaml #24
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: | |
# 手动触发部署 | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
# 添加权限配置 | |
permissions: | |
contents: write | |
pages: write | |
id-token: write | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18' | |
cache: 'npm' | |
- name: Install Dependencies | |
run: npm ci | |
- name: Build | |
run: npm run build | |
- name: Add cname | |
run: echo "eliza101.xyz" > ./packages/page/dist//CNAME | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./packages/page/dist/ | |
# 保持提交历史 | |
force_orphan: false | |
commit_message: 'deploy: ${{ github.event.head_commit.message }}' |