Skip to content

docs: docs

docs: docs #428

name: "docs-branch-push"
on:
push:
branches:
- "docs"
jobs:
pre-release:
name: "docs branch push"
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
npm install
# yarn install
- name: Build
run: |
yarn build
yarn run baiduPush
- name: Commit dist files
run: |
cd docs/.vuepress/dist
git init
git config --global user.name "${{ secrets.USERNAME }}"
git config --global user.email "${{ secrets.EMAIL }}"
git add -A
git commit -m 'deploy'
git push --quiet --force https://${{ secrets.TOKEN }}@github.com/yiliang114/yiliang114.github.io.git master:master