Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a5b9c7a

Browse files
committedApr 9, 2024··
deploy to gh pages
1 parent 6f2d067 commit a5b9c7a

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed
 

‎.github/workflows/deploy.yml

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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

‎vocs.config.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { defineConfig } from "vocs";
33
export default defineConfig({
44
title: "Polkadot-API",
55
description: "Typescript API to interact with polkadot chains",
6+
basePath: "/polkadot-api-docs",
67
sidebar: [
78
{
89
text: "Getting Started",

0 commit comments

Comments
 (0)
Please sign in to comment.