Update package.json #6
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: pushDocs | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
# This workflow contains a single job called "build" | |
build: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# 具体的执行步骤 | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- name: Checkout | |
uses: actions/checkout@main | |
# 使用的node版本 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@main | |
with: | |
node-version: ${{ matrix.node }} | |
# 执行安装 | |
- name: Install dependencies | |
run: npm install | |
# 执行打包 | |
- name: Build VuePress | |
run: npm run build | |
# 执行部署 | |
- name: Deploy to Pages | |
run: | | |
cd .vitepress/dist | |
git init | |
git config user.name "gelxgx" | |
git config user.email "${{ secrets.GIT_EMAIL }}" | |
git add -A | |
git commit -m 'deploy' | |
git push -f https://gelxgx:${{ secrets.ACCESS_TOKEN }}@github.com/gelxgx/blog.git master:gh-pages | |
cd - |