File tree 2 files changed +48
-0
lines changed
2 files changed +48
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : deploy
2
+
3
+ on :
4
+ push :
5
+ branches : [main]
6
+
7
+ jobs :
8
+ deploy :
9
+ runs-on : ubuntu-latest
10
+
11
+ steps :
12
+ - uses : actions/checkout@v4
13
+ - name : Install dependencies
14
+ run : npm i
15
+ - name : Build
16
+ run : npm run build
17
+ - name : Setup git credentials
18
+ run : |
19
+ mkdir --parents ~/.ssh
20
+ DEPLOY_KEY_FILE=~/.ssh/deploy_key
21
+ echo "${{ secrets.SSH_DEPLOY_KEY }}" > "$DEPLOY_KEY_FILE"
22
+ chmod 600 "$DEPLOY_KEY_FILE"
23
+
24
+ SSH_KNOWN_HOSTS_FILE="$HOME/.ssh/known_hosts"
25
+ ssh-keyscan -H "github.com" > "$SSH_KNOWN_HOSTS_FILE"
26
+
27
+ - name : Clone deploy repo
28
+ run : |
29
+ DEPLOY_KEY_FILE=~/.ssh/deploy_key
30
+ SSH_KNOWN_HOSTS_FILE="$HOME/.ssh/known_hosts"
31
+ export GIT_SSH_COMMAND="ssh -i "$DEPLOY_KEY_FILE" -o UserKnownHostsFile=$SSH_KNOWN_HOSTS_FILE"
32
+ mkdir deploy
33
+ cd deploy
34
+ git clone git@github.com:polkadot-api/polkadot-api-docs.git ./
35
+ git checkout --track origin/gh-pages
36
+ /bin/rm -rf *
37
+ cd ..
38
+ - name : Move new release
39
+ run : cp -R dist/* deploy/
40
+ - name : Commit and push
41
+ run : |
42
+ DEPLOY_KEY_FILE=~/.ssh/deploy_key
43
+ SSH_KNOWN_HOSTS_FILE="$HOME/.ssh/known_hosts"
44
+ export GIT_SSH_COMMAND="ssh -i "$DEPLOY_KEY_FILE" -o UserKnownHostsFile=$SSH_KNOWN_HOSTS_FILE"
45
+ cd deploy
46
+ git commit -m "deploy latest main"
47
+ git push origin gh-pages
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { defineConfig } from "vocs";
3
3
export default defineConfig ( {
4
4
title : "Polkadot-API" ,
5
5
description : "Typescript API to interact with polkadot chains" ,
6
+ basePath : "/polkadot-api-docs" ,
6
7
sidebar : [
7
8
{
8
9
text : "Getting Started" ,
You can’t perform that action at this time.
0 commit comments