Skip to content

Update deploy.yml

Update deploy.yml #9

Workflow file for this run

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: |
ls
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 -