Archived
1
0
Fork 0
This repository has been archived on 2024-04-26. You can view files and clone it, but cannot push or open issues or pull requests.
akari-bot/.github/workflows/doc.yml
2021-02-19 20:20:00 +08:00

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 }}