chore: setup CI

This commit is contained in:
mutoe 2020-09-27 23:56:27 +08:00
parent d3b5b36c54
commit 6f61ced192
1 changed files with 55 additions and 0 deletions

55
.github/workflows/nodejs.yml vendored Normal file
View File

@ -0,0 +1,55 @@
name: Node CI
on: [push]
jobs:
build:
env:
CI: true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: 12.x
- 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
run: yarn install --skip-integrity-check --non-interactive --no-progress
# - name: lint
# run: yarn lint
#
# - name: lint
# run: yarn test --coverage
#
# - name: collect coverage
# uses: coverallsapp/github-action@v1.0.1
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
- name: build
run: |
cp .env .env.local
sed -i "/BASE_URL/s#/#/vue3-realworld-example-app/#" .env.local
yarn build
- name: deploy
uses: s0/git-publish-subdir-action@master
env:
REPO: self
BRANCH: gh-pages
FOLDER: dist
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}