2024-04-24 02:40:17 +02:00
|
|
|
name: Deploy to GitHub Pages
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: 'main'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build_site:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
container: jimfx/nodes:latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: pnpm install
|
|
|
|
|
|
|
|
- name: build
|
|
|
|
run: pnpm run build
|
|
|
|
|
2024-04-24 03:16:24 +02:00
|
|
|
- name: 🔑 Configure rclone
|
|
|
|
run: |
|
|
|
|
echo "$SSH_PRIVATE_KEY" > /tmp/id_rsa
|
|
|
|
chmod 600 /tmp/id_rsa
|
|
|
|
mkdir -p ~/.config/rclone
|
2024-04-24 03:20:21 +02:00
|
|
|
echo "[sftp-remote]\ntype = sftp\nhost = ${SSH_HOST}\nuser = ${SSH_USER}\nport = ${SSH_PORT}\nkey_file = /tmp/id_rsa" > ~/.config/rclone/rclone.conf
|
2024-04-24 03:16:24 +02:00
|
|
|
env:
|
|
|
|
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
|
|
|
|
SSH_HOST: ${{ vars.SSH_HOST }}
|
|
|
|
SSH_PORT: ${{ vars.SSH_PORT }}
|
|
|
|
SSH_USER: ${{ vars.SSH_USER }}
|
|
|
|
|
|
|
|
- name: 🚀 Deploy Changed Files via rclone
|
|
|
|
run: |
|
|
|
|
echo "Uploading the rest"
|
|
|
|
rclone sync --update -v --progress --exclude _astro/** --stats 2s --stats-one-line ./app/build/ sftp-remote:${REMOTE_DIR} --transfers 4
|
|
|
|
env:
|
|
|
|
REMOTE_DIR: ${{ vars.REMOTE_DIR }}
|