-
Notifications
You must be signed in to change notification settings - Fork 9
52 lines (50 loc) · 1.53 KB
/
docs-deploy.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
50
51
52
name: Docs deploy
on:
push:
branches: [master]
paths:
- 'src/**'
- 'website/**'
- 'README.md'
- '.github/workflows/docs-deploy.yml'
workflow_dispatch:
jobs:
docs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install dependencies
run: |
npm ci
cd website && npm install && cd -
- name: Build documentation
run: cd website && npm run build && cd -
- name: Build API documentation
run: npm run docs:api
- name: Zip docs
run: |
mv docs website/build/docs/api
cd website/build
zip -r docs.zip .
- name: Copy docs to Toolforge
uses: appleboy/scp-action@9ba62064d28ce0897a970e72cdfe30b9fde2fe48
with:
source: ${{github.workspace}}/website/build/docs.zip
strip_components: 4
target: /data/project/mwn
host: login.toolforge.org
username: ${{secrets.TOOLFORGE_USERNAME}}
key: ${{secrets.TOOLFORGE_PRIVATE_KEY}}
- name: Unzip
uses: appleboy/ssh-action@551964ebda1034f0b5449d74db25c42e371ca1f7
with:
script: |
cd /data/project/mwn/www/static
shopt -s extglob
rm -r -- !(coverage)
unzip /data/project/mwn/docs.zip -d .
rm /data/project/mwn/docs.zip
host: login.toolforge.org
username: ${{secrets.TOOLFORGE_USERNAME}}
key: ${{secrets.TOOLFORGE_PRIVATE_KEY}}