ci: switch to Github Actions

This commit is contained in:
Lolipop 2021-07-14 14:02:03 +08:00
parent fe134dff26
commit 5c1cd30134
2 changed files with 38 additions and 19 deletions

38
.github/workflows/deploy.yml vendored Normal file
View File

@ -0,0 +1,38 @@
name: Vuepress Deployment
on:
push:
branches:
- main
jobs:
pages:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: '14.x'
- name: Cache NPM dependencies
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.OS }}-npm-cache
restore-keys: |
${{ runner.OS }}-npm-cache
- name: Install Dependencies
run: |
cd vuepress
npm install
- name: Build
run: |
cd vuepress
npm run build
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
deploy_key: ${{ secrets.ACCESS_TOKEN }}
publish_dir: vuepress/docs/.vuepress/dist
publish_branch: gh-pages

View File

@ -1,19 +0,0 @@
language: node_js
node_js:
- lts/*
branches:
only:
- main
install:
- cd vuepress
- yarn install
script:
- yarn build
deploy:
provider: pages
skip_cleanup: true
local_dir: vuepress/docs/.vuepress/dist
github_token: $CI_DEPLOY_TOKEN
keep_history: true
on:
branch: main