github: check if it's dns

Signed-off-by: Naman Sood <mail@nsood.in>
This commit is contained in:
Naman Sood 2023-08-14 20:10:41 -04:00
parent c83152b321
commit 2065fed00c

View file

@ -27,7 +27,7 @@ jobs:
run: | run: |
set -euxo pipefail set -euxo pipefail
mkdir -p ~/.ssh mkdir -p ~/.ssh
ssh-keyscan $MACHINE > ~/.ssh/known_hosts ssh-keyscan $(tailscale ip -4 $MACHINE) > ~/.ssh/known_hosts
printf "%s" "$SSH_KEY" > ~/.ssh/key printf "%s" "$SSH_KEY" > ~/.ssh/key
chmod 600 ~/.ssh/key chmod 600 ~/.ssh/key
@ -46,7 +46,7 @@ jobs:
FILENAME=prose-${TIME}.tar.gz FILENAME=prose-${TIME}.tar.gz
mkdir -p static/css mkdir -p static/css
tar -czf $FILENAME prose fonts/ static/ styles/ templates/ posts/ tar -czf $FILENAME prose fonts/ static/ styles/ templates/ posts/
echo $FILENAME "github@$MACHINE:/home/github/" echo $FILENAME "github@$(tailscale ip -4 $MACHINE):/home/github/"
scp -i ~/.ssh/key $FILENAME "github@$MACHINE:/home/github/" scp -i ~/.ssh/key $FILENAME "github@$(tailscale ip -4 $MACHINE):/home/github/"
ssh -i ~/.ssh/key "github@$MACHINE" "tar -C /var/www/blog -xzf ~/$FILENAME" ssh -i ~/.ssh/key "github@$(tailscale ip -4 $MACHINE)" "tar -C /var/www/blog -xzf ~/$FILENAME"
ssh -i ~/.ssh/key "github@$MACHINE" "sudo systemctl restart prose" ssh -i ~/.ssh/key "github@$(tailscale ip -4 $MACHINE)" "sudo systemctl restart prose"