Skip to content

Commit a555fdf

Browse files
authored
Fix double deployments (#409)
1 parent 8dde61e commit a555fdf

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

.github/workflows/deploy.yml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@ on:
55
branches:
66
- main
77
- develop
8-
pull_request:
9-
types: [closed]
10-
branches:
11-
- main
12-
- develop
138
workflow_dispatch:
149
inputs:
1510
environment:
@@ -30,8 +25,6 @@ jobs:
3025
backend:
3126
name: Deploy Backend
3227
runs-on: ubuntu-latest
33-
# Only run this job when a PR is merged (not when closed without merging)
34-
if: github.event_name != 'pull_request' || github.event.pull_request.merged == true
3528

3629
steps:
3730
- uses: actions/checkout@v3
@@ -67,7 +60,7 @@ jobs:
6760
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
6861
echo "VAPOR_ENV=${{ github.event.inputs.environment }}" >> "$GITHUB_ENV"
6962
echo "TEST_MODE=${{ github.event.inputs.test_mode }}" >> "$GITHUB_ENV"
70-
elif [[ "${{ github.base_ref }}" == "develop" || "${{ github.ref_name }}" == "develop" ]]; then
63+
elif [[ "${{ github.ref_name }}" == "develop" ]]; then
7164
echo "VAPOR_ENV=staging" >> "$GITHUB_ENV"
7265
echo "TEST_MODE=false" >> "$GITHUB_ENV"
7366
else
@@ -99,8 +92,6 @@ jobs:
9992
name: Deploy Frontend
10093
runs-on: ubuntu-latest
10194
needs: backend
102-
# Only run this job when a PR is merged (not when closed without merging)
103-
if: github.event_name != 'pull_request' || github.event.pull_request.merged == true
10495

10596
steps:
10697
- uses: actions/checkout@v3
@@ -114,7 +105,7 @@ jobs:
114105
echo "DO_APP_ID=${{ secrets.DIGITALOCEAN_PRODUCTION_APP_ID }}" >> "$GITHUB_ENV"
115106
fi
116107
echo "TEST_MODE=${{ github.event.inputs.test_mode }}" >> "$GITHUB_ENV"
117-
elif [[ "${{ github.base_ref }}" == "develop" || "${{ github.ref_name }}" == "develop" ]]; then
108+
elif [[ "${{ github.ref_name }}" == "develop" ]]; then
118109
echo "DO_APP_ID=${{ secrets.DIGITALOCEAN_STAGING_APP_ID }}" >> "$GITHUB_ENV"
119110
echo "TEST_MODE=false" >> "$GITHUB_ENV"
120111
else

0 commit comments

Comments
 (0)