chore(tooling): integrate forgejo workflow's deploy step into the makefile's
All checks were successful
/ deploy (push) Has been skipped
/ publish (push) Has been skipped
/ build (push) Has been skipped
/ test (push) Successful in 17s

This commit is contained in:
Julien Dessaux 2025-04-09 18:20:24 +02:00
parent 605b195085
commit 060942051f
Signed by: adyxax
GPG key ID: F92E51B86E07177E
2 changed files with 12 additions and 7 deletions

View file

@ -50,11 +50,7 @@ jobs:
with:
name: 'ods'
- run: |
umask 077
printf '%s' "$SSH_PRIVATE_KEY" | base64 -d > private_key
SSHOPTS="-i private_key -o StrictHostKeyChecking=accept-new"
rsync -e "ssh ${SSHOPTS}" ods ods@ods.adyxax.org:
ssh ${SSHOPTS} ods@ods.adyxax.org "chmod +x ods; systemctl --user restart ods"
make deploy
env:
SSH_PRIVATE_KEY: '${{ secrets.SSH_PRIVATE_KEY }}'
publish:

View file

@ -37,8 +37,17 @@ push: tidy no-dirty check ## push changes to git remote
.PHONY: deploy
deploy: build ## deploy changes to the production server
rsync ./ods ods@ods.adyxax.org:
ssh ods@ods.adyxax.org "systemctl --user restart ods"
umask 077
if [ -n "$${SSH_PRIVATE_KEY:-}" ]; then
cleanup() {
rm -f private_key
}
trap cleanup EXIT
printf '%s' "$$SSH_PRIVATE_KEY" | base64 -d > private_key
SSHOPTS="-i private_key -o StrictHostKeyChecking=accept-new"
fi
rsync -e "ssh $${SSHOPTS:-}" ./ods ods@ods.adyxax.org:
ssh $${SSHOPTS:-} ods@ods.adyxax.org "chmod +x ods; systemctl --user restart ods"
##### Utils ####################################################################
.PHONY: confirm