deployment bug fixes #5
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: Trigger Deployment | |
| # # This workflow triggers a webhook that your instance listens for | |
| # # The instance will then pull the latest code and rebuild | |
| # on: | |
| # push: | |
| # branches: | |
| # - main | |
| # - dev | |
| # jobs: | |
| # notify: | |
| # runs-on: ubuntu-latest | |
| # # Determine environment based on branch | |
| # environment: ${{ github.ref == 'refs/heads/main' && 'production' || 'staging' }} | |
| # steps: | |
| # - name: Trigger deployment webhook | |
| # run: | | |
| # ENVIRONMENT="${{ github.ref == 'refs/heads/main' && 'production' || 'staging' }}" | |
| # WEBHOOK_URL="${{ secrets.WEBHOOK_URL }}" | |
| # WEBHOOK_SECRET="${{ secrets.WEBHOOK_SECRET }}" | |
| # # Create payload | |
| # PAYLOAD=$(cat <<EOF | |
| # { | |
| # "ref": "${{ github.ref }}", | |
| # "branch": "${{ github.ref_name }}", | |
| # "commit": "${{ github.sha }}", | |
| # "environment": "$ENVIRONMENT", | |
| # "repository": "${{ github.repository }}" | |
| # } | |
| # EOF | |
| # ) | |
| # # Send webhook with secret for authentication | |
| # curl -X POST "$WEBHOOK_URL" \ | |
| # -H "Content-Type: application/json" \ | |
| # -H "X-GitHub-Event: push" \ | |
| # -H "X-Webhook-Secret: $WEBHOOK_SECRET" \ | |
| # -d "$PAYLOAD" \ | |
| # --fail --show-error | |
| # echo "Deployment webhook triggered for $ENVIRONMENT" |