Skip to content

Commit

Permalink
deploy to gh pages
Browse files Browse the repository at this point in the history
  • Loading branch information
voliva committed Apr 9, 2024
1 parent 6f2d067 commit e16bc98
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: deploy

on:
push:
branches: [main]

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: npm i
- name: Build
run: npm run build
- name: Setup git credentials
run: |
mkdir --parents ~/.ssh
DEPLOY_KEY_FILE=~/.ssh/deploy_key
echo "${{ secrets.SSH_DEPLOY_KEY }}" > "$DEPLOY_KEY_FILE"
chmod 600 "$DEPLOY_KEY_FILE"
SSH_KNOWN_HOSTS_FILE="$HOME/.ssh/known_hosts"
ssh-keyscan -H "github.com" > "$SSH_KNOWN_HOSTS_FILE"
- name: Clone deploy repo
run: |
DEPLOY_KEY_FILE=~/.ssh/deploy_key
SSH_KNOWN_HOSTS_FILE="$HOME/.ssh/known_hosts"
export GIT_SSH_COMMAND="ssh -i "$DEPLOY_KEY_FILE" -o UserKnownHostsFile=$SSH_KNOWN_HOSTS_FILE"
mkdir deploy
cd deploy
git clone [email protected]:polkadot-api/polkadot-api-docs.git ./
git checkout --track origin/gh-pages
/bin/rm -rf *
cd ..
- name: Move new release
run: cp -R docs/dist/* deploy/
- name: Commit and push
run: |
DEPLOY_KEY_FILE=~/.ssh/deploy_key
SSH_KNOWN_HOSTS_FILE="$HOME/.ssh/known_hosts"
export GIT_SSH_COMMAND="ssh -i "$DEPLOY_KEY_FILE" -o UserKnownHostsFile=$SSH_KNOWN_HOSTS_FILE"
cd deploy
git config --global user.email "[email protected]"
git config --global user.name "Github Deployment"
git add .
git commit -m "deploy latest main"
git push origin gh-pages
1 change: 1 addition & 0 deletions vocs.config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { defineConfig } from "vocs";
export default defineConfig({
title: "Polkadot-API",
description: "Typescript API to interact with polkadot chains",
basePath: "/polkadot-api-docs",
sidebar: [
{
text: "Getting Started",
Expand Down

0 comments on commit e16bc98

Please sign in to comment.