Update restart.sh
All checks were successful
Deploy ${{ gitea.repository }} / build (push) Successful in 37s

This commit is contained in:
Adam Jeniski 2025-11-15 20:27:22 -10:00
parent dc0940caa5
commit 970e1c7ec4

View File

@ -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
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