-
Notifications
You must be signed in to change notification settings - Fork 5
50 lines (47 loc) · 1.49 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
name: Docs deploy
on:
push:
branches: [ 'master' ]
release:
types: [ 'created' ]
workflow_dispatch:
jobs:
deploydocs:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- run: npm ci
- run: npm run docs
- name: Upload docs to Toolforge
uses: appleboy/scp-action@9ba62064d28ce0897a970e72cdfe30b9fde2fe48
with:
source: ${{github.workspace}}/docs/*
target: /data/project/twinkle/www/static/core-docs
host: login.toolforge.org
username: ${{ secrets.TOOLFORGE_USERNAME }}
key: ${{ secrets.TOOLFORGE_PRIVATE_KEY }}
rm: true
versiondocs:
needs: deploydocs
runs-on: ubuntu-latest
if: ${{github.event_name == 'release'}}
steps:
- uses: actions/checkout@v4
- name: Read package.json version
uses: martinbeentjes/npm-get-version-action@master
id: get-version
- name: Save the documentation with version number
uses: appleboy/ssh-action@551964ebda1034f0b5449d74db25c42e371ca1f7
with:
script: >-
become twinkle bash -c '
cd /data/project/twinkle/www/static;
cp -r core-docs "core-docs-${{ steps.get-version.outputs.current-version }}";
'
host: login.toolforge.org
username: ${{ secrets.TOOLFORGE_USERNAME }}
key: ${{ secrets.TOOLFORGE_PRIVATE_KEY }}