Pushly CI/CD Pipeline Builder

Create automated deployment pipelines for your projects with GitHub Actions. Follow these simple steps to set up continuous deployment.

2

Login & Generate Access Token

Create an access token via the authentication API

2

Get Project ID

Enter your project subdomain or URL

โš ๏ธ Please complete Step 1 (Login) first

3

Add GitHub Secrets

Configure your repository secrets for automated deployments

Required Secrets

โš ๏ธ Complete previous steps: Please complete Steps 1 and 2 to see the secret values here.

Key
PROJECT_ID
Value
Not available (complete Step 1)
Key
PUSHLY_TOKEN
Value
Not available (complete Step 2)

๐Ÿ’ก 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.

4

Generate GitHub Actions YAML

One workflow ยท Auto PROD/STAGING by branch

Any other branch will be treated as STAGING

Generated Workflow

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.