chore(tooling): integrate forgejo workflow's deploy step into the makefile's
Some checks failed
/ all (push) Has been cancelled
Some checks failed
/ all (push) Has been cancelled
This commit is contained in:
parent
02c1ac7cc2
commit
fe44862252
2 changed files with 13 additions and 9 deletions
|
@ -26,11 +26,6 @@ jobs:
|
||||||
make check no-dirty
|
make check no-dirty
|
||||||
- name: 'deploy'
|
- name: 'deploy'
|
||||||
run: |
|
run: |
|
||||||
umask 077
|
make deploy
|
||||||
printf '%s' "$SSH_PRIVATE_KEY" | base64 -d > private_key
|
|
||||||
SSHOPTS="-i private_key -o StrictHostKeyChecking=accept-new"
|
|
||||||
rsync -a --delete -e "ssh ${SSHOPTS}" public/ www@www.adyxax.org:/srv/www/public/
|
|
||||||
rsync -e "ssh ${SSHOPTS}" search/search www@www.adyxax.org:/srv/www/
|
|
||||||
ssh ${SSHOPTS} www@www.adyxax.org "chmod +x search; systemctl --user restart www-search"
|
|
||||||
env:
|
env:
|
||||||
SSH_PRIVATE_KEY: '${{ secrets.SSH_PRIVATE_KEY }}'
|
SSH_PRIVATE_KEY: '${{ secrets.SSH_PRIVATE_KEY }}'
|
||||||
|
|
15
GNUmakefile
15
GNUmakefile
|
@ -36,9 +36,18 @@ serve: ## make serve # hugo web server development mode
|
||||||
##### Operations ###############################################################
|
##### Operations ###############################################################
|
||||||
.PHONY: deploy
|
.PHONY: deploy
|
||||||
deploy: ## make deploy
|
deploy: ## make deploy
|
||||||
rsync -a --delete public/ www@www.adyxax.org:/srv/www/public/
|
umask 077
|
||||||
rsync search/search www@www.adyxax.org:/srv/www/
|
if [ -n "${SSH_PRIVATE_KEY:-}" ]; then
|
||||||
ssh www@www.adyxax.org "systemctl --user restart www-search"
|
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 -a --delete -e "ssh ${SSHOPTS:-}" public/ www@www.adyxax.org:/srv/www/public/
|
||||||
|
rsync -e "ssh ${SSHOPTS:-}" search/search www@www.adyxax.org:/srv/www/
|
||||||
|
ssh ${SSHOPTS:-} www@www.adyxax.org "chmod +x search; systemctl --user restart www-search"
|
||||||
|
|
||||||
##### Quality ##################################################################
|
##### Quality ##################################################################
|
||||||
.PHONY: check
|
.PHONY: check
|
||||||
|
|
Loading…
Add table
Reference in a new issue