This commit is contained in:
parent
5797756d03
commit
fc195dc1b7
2 changed files with 0 additions and 28 deletions
|
@ -14,8 +14,6 @@ jobs:
|
||||||
submodules: 'true'
|
submodules: 'true'
|
||||||
- name: Run build task
|
- name: Run build task
|
||||||
run: hugo --minify
|
run: hugo --minify
|
||||||
- name: Test static page
|
|
||||||
run: bash ${{ gitea.workspace }}/bin/test_static_page.sh
|
|
||||||
- name: Deploy to Server
|
- name: Deploy to Server
|
||||||
uses: https://git.myco.systems/mirrors/ssh-deploy@main
|
uses: https://git.myco.systems/mirrors/ssh-deploy@main
|
||||||
env:
|
env:
|
||||||
|
|
|
@ -1,26 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
PORT=8080
|
|
||||||
python3 -m http.server $PORT --directory public/ &
|
|
||||||
|
|
||||||
SERVER_PID=$!
|
|
||||||
|
|
||||||
# Give it a moment to start
|
|
||||||
sleep 2
|
|
||||||
|
|
||||||
# Check if the server is running
|
|
||||||
if ! ps -p $SERVER_PID > /dev/null; then
|
|
||||||
echo "HTTP server failed to start."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Check HTTP status
|
|
||||||
status_code=$(curl -o /dev/null -s -w "%{http_code}" http://localhost:$PORT)
|
|
||||||
|
|
||||||
# Kill the http server
|
|
||||||
kill $SERVER_PID
|
|
||||||
|
|
||||||
# Check if status code is 200
|
|
||||||
if [ "$status_code" -ne 200 ]; then
|
|
||||||
echo "Website returned a non-200 status code: $status_code"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
Loading…
Add table
Reference in a new issue