From 970e1c7ec46cb823993023c7feb30690208dc780 Mon Sep 17 00:00:00 2001 From: Adam Jeniski Date: Sat, 15 Nov 2025 20:27:22 -1000 Subject: [PATCH] Update restart.sh --- restart.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/restart.sh b/restart.sh index 573efd2..446b612 100644 --- a/restart.sh +++ b/restart.sh @@ -1,9 +1,14 @@ #!/bin/bash -JOB_ID="$(curl https://git.ajet.fyi/api/v1/repos/ajet-industries/blog?limit=1 -H "Content-Type: application/json" | jq '.id)' +set -ve -rm -rf /var/www/html/* -curl https://git.ajet.fyi/ajet-industries/blog/actions/runs/9/artifacts/blog --output /var/www/html -unzip /var/www/html/blog -rm /var/www/html/blog -systemctl restart nginx +JOB_URL=$(curl https://git.ajet.fyi/api/v1/repos/ajet-industries/blog/actions/tasks | jq '.workflow_runs[0].url' -r) +echo $JOB_URL +ARTIFACT_URL="$JOB_URL/artifacts/blog" +echo $ARTIFACT_URL +rm /var/www/html/* -rf || echo "files not found to delete" +cd /var/www/html +curl $ARTIFACT_URL --output blog +unzip blog +rm blog +systemctl restart nginx \ No newline at end of file