Skip to content

Instantly share code, notes, and snippets.

@LukaSikic
Created November 20, 2021 14:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save LukaSikic/9a55e07f18a3781f8c1c927d3e269cfd to your computer and use it in GitHub Desktop.
Save LukaSikic/9a55e07f18a3781f8c1c927d3e269cfd to your computer and use it in GitHub Desktop.
forge_deploy
#!/bin/bash
# File: /usr/local/bin/forge_deploy
# Before using add FORGETOKEN to env variables in .zshrc like: export FORGETOKEN="ey..."
. .forge
if [ $(curl -Li -X POST https://forge.laravel.com/api/v1/servers/$FORGE_SERVER_ID/sites/$FORGE_SITE_ID/deployment/deploy -o /dev/null -w '%{http_code}\n' -s -H "Accept: application/json" -H "Authorization: Bearer $FORGETOKEN") == "200" ]
then
echo "Queued for deployment"
else
echo "Something went wrong"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment