Deploy site files #3
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 site files | |
on: | |
push: | |
branches: | |
- sourcecode # 只在master上push触发部署 | |
paths-ignore: # 下列文件的变更不触发部署,可以自行添加 | |
- README.md | |
- LICENSE | |
pull_request: | |
branches: | |
- sourcecode # 只在master上push触发部署 | |
types: [closed] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [12.x] | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
repo-token: ${{ secrets.DEPLOY_TOKEN }} | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install dependencies | |
run: | | |
npm i | |
- name: Build | |
run: | | |
npm run build | |
cp README.md docs/.vuepress/dist/ | |
cp 前端的进击.pdf docs/.vuepress/dist/ | |
cd docs/.vuepress/dist | |
- name: Deploy | |
uses: JamesIves/[email protected] | |
with: | |
GITHUB_TOKEN: ${{ secrets.DEPLOY_TOKEN }} | |
BRANCH: main # The branch the action should deploy to. | |
FOLDER: docs/.vuepress/dist/ | |
CLEAN: true |