Skip to content

style: run prettier #18

style: run prettier

style: run prettier #18

Workflow file for this run

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