Merge branch 'main' into development #7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Docusaurus 🦖 GitHub Pages" | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- name: Check out repo | |
uses: actions/checkout@v4 | |
# Node is required for pnpm | |
- name: Set up Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "20" | |
# Setup pnpm | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: latest | |
run_install: false | |
# Get pnpm store directory | |
- name: Get pnpm store directory | |
shell: bash | |
run: | | |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
# Setup pnpm cache | |
- name: Setup pnpm cache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.STORE_PATH }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
# Install and build Docusaurus website | |
- name: Build Docusaurus website | |
run: | | |
pnpm install | |
pnpm run build | |
- name: Set up SSH key | |
run: | | |
#set -ex | |
mkdir -p ~/.ssh | |
echo "${{ secrets.SSHKEY }}" > ~/.ssh/id_rsa | |
#cat ~/.ssh/id_rsa | |
chmod 600 ~/.ssh/id_rsa | |
eval $(ssh-agent -s) | |
ssh-add ~/.ssh/id_rsa | |
ssh-keyscan -H info.ourworld.tf >> ~/.ssh/known_hosts | |
# Test SSH connection | |
ssh -o StrictHostKeyChecking=no -T [email protected] || true | |
- name: Deploy with rsync | |
run: | | |
rsync -avz -e "ssh -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa" ./build/ [email protected]:/root/hero/www/info/eden/ |