Create automated deployment pipelines for your projects with GitHub Actions. Follow these simple steps to set up continuous deployment.
Create an access token via the authentication API
Enter your project subdomain or URL
โ ๏ธ Please complete Step 1 (Login) first
Configure your repository secrets for automated deployments
โ ๏ธ Complete previous steps: Please complete Steps 1 and 2 to see the secret values here.
PROJECT_IDPUSHLY_TOKEN๐ก Tip: Copy the Key name and Value separately. In GitHub Secrets, use the Key as the secret name and paste the Value as the secret value. Both must be added exactly as shown above.
One workflow ยท Auto PROD/STAGING by branch
Any other branch will be treated as STAGING
name: Pushly Auto Deploy
on:
push:
branches:
- "**"
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Determine Environment
run: |
if [ "${{ github.ref_name }}" = "main" ]; then
echo "ENVIRONMENT=PRODUCTION" >> $GITHUB_ENV
else
echo "ENVIRONMENT=STAGING" >> $GITHUB_ENV
fi
- name: Create Deployment
run: |
RESPONSE=$(curl -s -X POST "https://api.wareality.tech/api/projects/${{ secrets.PROJECT_ID }}/deployments" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${{ secrets.PUSHLY_TOKEN }}" \
-d "{
\"gitCommitHash\": \"${{ github.sha }}\",
\"gitBranch\": \"${{ github.ref_name }}\",
\"environment\": \"$ENVIRONMENT\"
}")
DEPLOYMENT_ID=$(echo $RESPONSE | jq -r '.id')
if [ -z "$DEPLOYMENT_ID" ] || [ "$DEPLOYMENT_ID" = "null" ]; then
echo "โ Failed to create deployment"
exit 1
fi
echo "deployment_id=$DEPLOYMENT_ID" >> $GITHUB_ENV
- name: Trigger Deployment
run: |
curl -s -X POST "https://api.wareality.tech/api/projects/${{ secrets.PROJECT_ID }}/deployments/${{ env.deployment_id }}/deploy?environment=$ENVIRONMENT" \
-H "Authorization: Bearer ${{ secrets.PUSHLY_TOKEN }}"
- name: Done
run: echo "๐ Deployment triggered successfully"
Need help? Check out our documentation or contact support.