Added an API route to make freelance work request that sends the deve… #17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Update Portfolio Server | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: [ main ] | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Call update API | |
| env: | |
| TOKEN: ${{ secrets.API_BEARER_TOKEN }} | |
| run: | | |
| set -e | |
| echo "▶ Calling update API..." | |
| RESPONSE=$(curl -w "\n%{http_code}" -X POST \ | |
| -H "Authorization: Bearer $TOKEN" \ | |
| https://jelius.dev/api/update_server) | |
| STATUS=$(echo "$RESPONSE" | tail -n1) | |
| echo "▶ Status: $STATUS" | |
| if [ "$STATUS" -ge 400 ]; then | |
| echo "API call failed" | |
| exit 1 | |
| fi |