Merge pull request #72 from yiliang114/dependabot/npm_and_yarn/word-w… #433
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: "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 |