-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (41 loc) · 1.44 KB
/
docs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Build docs and push to ezez.dev
on:
push:
branches: [ master ]
env:
PROJECT_NAME: hooks
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
- name: Build documentation
run: |
VER=$(cat ./package.json | jq -r .version)
echo Detected version: $VER
if [[ "$VER" == *"+"* ]]; then echo "WIP/+ version detected, skipping"; exit 1; fi
yarn
yarn docs
echo "APP_VERSION=$VER" >> "$GITHUB_ENV"
cat $GITHUB_ENV
- name: Deploy versioned documentation
uses: easingthemes/ssh-deploy@main
env:
SSH_PRIVATE_KEY: ${{ secrets.DOCS_SERVER_PRIVATE_KEY }}
REMOTE_HOST: ${{ secrets.DOCS_SERVER_HOST }}
REMOTE_USER: ${{ secrets.DOCS_SERVER_USER }}
REMOTE_PORT: ${{ secrets.DOCS_SERVER_PORT }}
SOURCE: "docs/"
TARGET: "/docs/${{ env.PROJECT_NAME }}/${{ env.APP_VERSION }}"
- name: Deploy latest documentation
uses: easingthemes/ssh-deploy@main
env:
SSH_PRIVATE_KEY: ${{ secrets.DOCS_SERVER_PRIVATE_KEY }}
REMOTE_HOST: ${{ secrets.DOCS_SERVER_HOST }}
REMOTE_USER: ${{ secrets.DOCS_SERVER_USER }}
REMOTE_PORT: ${{ secrets.DOCS_SERVER_PORT }}
ARGS: "-rlgoDzvc -i --delete"
SOURCE: "docs/"
TARGET: "/docs/${{ env.PROJECT_NAME }}/latest"