Skip to content

Open-source event management and ticket selling platform — perfect for concerts, conferences, and everything in between 🎟️ If you find this project helpful, please consider giving us a star ⭐️

Update deploy workflow

Dave Earleyfbfda6a19cac
diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
index d23858127..2cc340dd3 100644
--- a/.github/workflows/deploy.yml
+++ b/.github/workflows/deploy.yml
@@ -5,6 +5,11 @@ on:
branches:
- main
- develop
+ pull_request:
+ types: [closed]
+ branches:
+ - main
+ - develop
workflow_dispatch:
inputs:
environment:
@@ -25,6 +30,8 @@ jobs:
backend:
name: Deploy Backend
runs-on: ubuntu-latest
+ # Only run this job when a PR is merged (not when closed without merging)
+ if: github.event_name != 'pull_request' || github.event.pull_request.merged == true
steps:
- uses: actions/checkout@v3
@@ -60,7 +67,7 @@ jobs:
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
echo "VAPOR_ENV=${{ github.event.inputs.environment }}" >> "$GITHUB_ENV"
echo "TEST_MODE=${{ github.event.inputs.test_mode }}" >> "$GITHUB_ENV"
- elif [[ "${{ github.ref_name }}" == "develop" ]]; then
+ elif [[ "${{ github.base_ref }}" == "develop" || "${{ github.ref_name }}" == "develop" ]]; then
echo "VAPOR_ENV=staging" >> "$GITHUB_ENV"
echo "TEST_MODE=false" >> "$GITHUB_ENV"
else
@@ -70,7 +77,7 @@ jobs:
- name: Log Branch and Environment
run: |
- echo "🚀 Deploying branch ${{ github.ref_name }} to Vapor environment: ${{ env.VAPOR_ENV }}"
+ echo "🚀 Deploying to Vapor environment: ${{ env.VAPOR_ENV }}"
echo "🧪 Test mode: ${{ env.TEST_MODE }}"
- name: Validate Deployment Configuration
@@ -92,6 +99,8 @@ jobs:
name: Deploy Frontend
runs-on: ubuntu-latest
needs: backend
+ # Only run this job when a PR is merged (not when closed without merging)
+ if: github.event_name != 'pull_request' || github.event.pull_request.merged == true
steps:
- uses: actions/checkout@v3
@@ -105,7 +114,7 @@ jobs:
echo "DO_APP_ID=${{ secrets.DIGITALOCEAN_PRODUCTION_APP_ID }}" >> "$GITHUB_ENV"
fi
echo "TEST_MODE=${{ github.event.inputs.test_mode }}" >> "$GITHUB_ENV"
- elif [[ "${{ github.ref_name }}" == "develop" ]]; then
+ elif [[ "${{ github.base_ref }}" == "develop" || "${{ github.ref_name }}" == "develop" ]]; then
echo "DO_APP_ID=${{ secrets.DIGITALOCEAN_STAGING_APP_ID }}" >> "$GITHUB_ENV"
echo "TEST_MODE=false" >> "$GITHUB_ENV"
else