Compare commits

...

7 Commits

Author SHA1 Message Date
995d4613e5 [deploy]
Some checks failed
Deploy on push / deploy (push) Failing after 29s
2025-08-19 23:15:17 +08:00
557827d9fd [deploy]
Some checks failed
Deploy on push / deploy (push) Failing after 4s
2025-08-19 23:13:40 +08:00
a6d1144bff [deploy] 2025-08-19 23:11:04 +08:00
fa145682b5 [deploy]
Some checks failed
Deploy on push / deploy (push) Failing after 5s
2025-08-19 23:04:15 +08:00
d50c042524 [deploy]
Some checks failed
Deploy on push / deploy (push) Failing after 8s
2025-08-19 22:59:54 +08:00
fc07d1aa5d [deploy]
Some checks failed
Deploy on push / deploy (push) Failing after 4s
2025-08-19 22:42:20 +08:00
59cdcd19e3 [deploy]
All checks were successful
Deploy on push / deploy (push) Successful in 11s
2025-08-13 06:19:30 +08:00
3 changed files with 16 additions and 11 deletions

View File

@@ -6,36 +6,40 @@ on:
jobs:
deploy:
runs-on: ubuntu-latest
runs-on: alpine-rsync
if: contains(gitea.event.head_commit.message, '[deploy]')
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install ssh + rsync
run: |
sudo apt-get update
sudo apt-get install -y openssh-client rsync
- name: Setup SSH
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
run: |
mkdir -p ~/.ssh
echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_ed25519
printf "%s" "$SSH_PRIVATE_KEY" > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
ssh-keyscan -p 22 "rchou.org" >> ~/.ssh/known_hosts
ssh-keyscan -p 22 "rchou.net" >> ~/.ssh/known_hosts
chmod 644 ~/.ssh/known_hosts
- name: Debug key + ssh
run: |
ssh -V
ls -la ~/.ssh
head -5 ~/.ssh/id_ed25519
ssh -i ~/.ssh/id_ed25519 -o StrictHostKeyChecking=no deploy@rchou.net "echo ok"
- name: Test SSH
run: ssh -i ~/.ssh/id_ed25519 deploy@rchou.net "echo 'SSH works!'"
- name: Rsync to server
env:
SSH_TARGET_DIR: /home/cab/docker/portfolio/src
SSH_TARGET_DIR: /home/cab/docker/websites/portfolio-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.org:${SSH_TARGET_DIR}/"
"$RSYNC_SOURCE"/ "deploy@rchou.net:${SSH_TARGET_DIR}/"

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
.DS_Store

0
push Normal file
View File