Skip to content

Commit 42aa218

Browse files
CI: Fix trigger bug (#586)
1 parent 2eacafa commit 42aa218

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

.github/workflows/Build-Test-And-Deploy.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ jobs:
5151
run: dotnet test --no-build --configuration Release
5252

5353
- name: Set up Docker Buildx
54-
if: github.event_name != 'pull_request_target'
54+
if: github.event_name != 'pull_request_target' && github.event_name != 'pull_request'
5555
uses: docker/setup-buildx-action@v3
5656

5757
- name: Build Container Image
58-
if: github.event_name != 'pull_request_target'
58+
if: github.event_name != 'pull_request_target' && github.event_name != 'pull_request'
5959
uses: docker/build-push-action@v6
6060
with:
6161
tags: ${{ vars.DEVCONTAINER_REGISTRY }}/essentialcsharpweb:${{ github.sha }},${{ vars.DEVCONTAINER_REGISTRY }}/essentialcsharpweb:latest,${{ vars.PRODCONTAINER_REGISTRY }}/essentialcsharpweb:${{ github.sha }},${{ vars.PRODCONTAINER_REGISTRY }}/essentialcsharpweb:latest
@@ -73,7 +73,7 @@ jobs:
7373
path: ${{ github.workspace }}/essentialcsharpwebimage.tar
7474

7575
deploy-development:
76-
if: github.event_name != 'pull_request_target'
76+
if: github.event_name != 'pull_request_target' && github.event_name != 'pull_request'
7777
runs-on: ubuntu-latest
7878
needs: build-and-test
7979
environment:
@@ -99,19 +99,16 @@ jobs:
9999
docker image ls -a
100100
101101
- name: Log in to container registry
102-
if: github.event_name != 'pull_request_target'
103102
uses: docker/login-action@v3
104103
with:
105104
registry: ${{ vars.DEVCONTAINER_REGISTRY }}
106105
username: ${{ secrets.ESSENTIALCSHARP_ACR_USERNAME }}
107106
password: ${{ secrets.ESSENTIALCSHARP_ACR_PASSWORD }}
108107

109108
- name: Push Image to Container Registry
110-
if: github.event_name != 'pull_request_target'
111109
run: docker push --all-tags ${{ vars.DEVCONTAINER_REGISTRY }}/essentialcsharpweb
112110

113111
- name: Create and Deploy to Container App
114-
if: github.event_name != 'pull_request_target'
115112
uses: azure/CLI@v2
116113
env:
117114
CONTAINER_APP_NAME: ${{ vars.CONTAINER_APP_NAME }}
@@ -161,7 +158,7 @@ jobs:
161158
az account clear
162159
163160
deploy-production:
164-
if: github.event_name != 'pull_request_target'
161+
if: github.event_name != 'pull_request_target' && github.event_name != 'pull_request'
165162
runs-on: ubuntu-latest
166163
needs: [deploy-development]
167164
environment:
@@ -187,15 +184,13 @@ jobs:
187184
docker image ls -a
188185
189186
- name: Log in to container registry
190-
if: github.event_name != 'pull_request_target'
191187
uses: docker/login-action@v3
192188
with:
193189
registry: ${{ vars.PRODCONTAINER_REGISTRY }}
194190
username: ${{ secrets.ESSENTIALCSHARP_ACR_USERNAME }}
195191
password: ${{ secrets.ESSENTIALCSHARP_ACR_PASSWORD }}
196192

197193
- name: Push Image to Container Registry
198-
if: github.event_name != 'pull_request_target'
199194
run: docker push --all-tags ${{ vars.PRODCONTAINER_REGISTRY }}/essentialcsharpweb
200195

201196
- name: Create and Deploy to Container App

0 commit comments

Comments
 (0)