Skip to content

Workflow file for this run

name: Build Gitbook and upload to self server
on: [ push ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out source code
uses: actions/checkout@v2
- name: Setup Node.js for use with actions
uses: actions/setup-node@v2.1.4
with:
node-version: '10'
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}
- name: install
run: |
npm root -g
sudo npm install -g gitbook-cli
gitbook install
- name: build
run: |
gitbook build
- name: copy dir to remote server
uses: appleboy/scp-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
source: "_book"
target: ${{secrets.DIR}}
key: ${{secrets.KEY}}
rm: true