md/.github/workflows/build.yml

45 lines
1.0 KiB
YAML
Raw Normal View History

2020-05-02 20:31:24 +08:00
name: Build and Deploy
2020-12-02 14:37:05 +08:00
2020-05-02 19:45:26 +08:00
on:
push:
2020-12-02 14:37:05 +08:00
branches: [ main ]
2020-05-02 19:45:26 +08:00
jobs:
2020-05-02 20:31:24 +08:00
build-and-deploy:
2020-05-02 19:45:26 +08:00
runs-on: ubuntu-latest
steps:
2020-05-02 20:31:24 +08:00
- name: Checkout
uses: actions/checkout@v2
with:
persist-credentials: false
2020-11-25 09:47:08 +08:00
- name: Set up node
uses: actions/setup-node@v2-beta
with:
node-version: '12'
check-latest: true
- name: Cache node modules
uses: actions/cache@v2
id: cache
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: npm install
2020-05-02 20:31:24 +08:00
2020-11-25 09:47:08 +08:00
- name: Build
run:
2020-05-02 20:31:24 +08:00
npm run build
2020-11-25 09:47:08 +08:00
2020-05-02 20:31:24 +08:00
- name: Deploy
2020-11-24 23:55:18 +08:00
uses: JamesIves/github-pages-deploy-action@3.7.1
2020-05-02 20:31:24 +08:00
with:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
BRANCH: gh-pages
FOLDER: dist