54 lines
1.4 KiB
YAML
54 lines
1.4 KiB
YAML
name: build and deploy
|
|
on:
|
|
workflow_dispatch
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
with:
|
|
ref: doc
|
|
|
|
- name: Setup Python 3.9
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: 3.9
|
|
|
|
- name: Install dependencies
|
|
run: pip install -r requirement.txt
|
|
|
|
- name: Build with mkdocs
|
|
run: mkdocs build
|
|
|
|
- name: Get yarn cache directory path
|
|
id: yarn-cache-dir-path
|
|
run: echo "::set-output name=dir::$(yarn cache dir)"
|
|
|
|
- uses: actions/cache@v2
|
|
id: yarn-cache
|
|
with:
|
|
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
|
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-yarn-
|
|
|
|
- name: Cache Node Modules
|
|
id: node-cache
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: node_modules
|
|
key: node-modules-${{ hashFiles('**/yarn.lock') }}
|
|
|
|
- name: Install
|
|
if: steps.node-cache.outputs.cache-hit != 'true'
|
|
run: yarn --no-lockfile
|
|
|
|
- name: Deploy to server
|
|
run: node deploy.js
|
|
env:
|
|
REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
|
|
REMOTE_USER: ${{ secrets.REMOTE_USER }}
|
|
REMOTE_PWD: ${{ secrets.REMOTE_PWD }}
|
|
REMOTE_PATH: ${{ secrets.REMOTE_PATH }}
|