From 97423e9573bf87e6a72960015ec415a812b2ea15 Mon Sep 17 00:00:00 2001 From: rchou Date: Tue, 19 Aug 2025 22:39:12 +0800 Subject: [PATCH] rchou.org -> rchou.net --- .gitea/workflows/pipeline.yml | 35 +++++++++++++++++++++++++++++++++++ .gitignore | 1 + 2 files changed, 36 insertions(+) create mode 100644 .gitea/workflows/pipeline.yml create mode 100644 .gitignore diff --git a/.gitea/workflows/pipeline.yml b/.gitea/workflows/pipeline.yml new file mode 100644 index 0000000..310b81b --- /dev/null +++ b/.gitea/workflows/pipeline.yml @@ -0,0 +1,35 @@ +name: Deploy on push + +on: + push: + branches: [ "main" ] + +jobs: + deploy: + runs-on: alpine-rsync + if: contains(gitea.event.head_commit.message, '[deploy]') + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup SSH + env: + SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} + run: | + mkdir -p ~/.ssh + echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_ed25519 + chmod 600 ~/.ssh/id_ed25519 + ssh-keyscan -p 22 "rchou.net" >> ~/.ssh/known_hosts + chmod 644 ~/.ssh/known_hosts + + - name: Rsync to server + env: + SSH_TARGET_DIR: /home/cab/docker/websites/gallery-src + RSYNC_SOURCE: . + run: | + rsync -rz --delete \ + --no-times --no-perms --no-owner --no-group \ + --omit-dir-times --mkpath \ + -e "ssh -i ~/.ssh/id_ed25519 -p 22" \ + "$RSYNC_SOURCE"/ "deploy@rchou.net:${SSH_TARGET_DIR}/" diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e43b0f9 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.DS_Store