Skip to content

Commit 79e5a4c

Browse files
committed
refactor(workflows): update push conditions for app on pr events
1 parent 2f85520 commit 79e5a4c

8 files changed

Lines changed: 105 additions & 73 deletions

.github/workflows/package-ai-service.yaml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
name: package-ai-service
22

33
on:
4+
pull_request:
5+
branches:
6+
- "main"
7+
paths:
8+
- "src/ai-service/**"
49
push:
510
branches:
6-
- 'main'
11+
- "main"
712
paths:
8-
- 'src/ai-service/**'
13+
- "src/ai-service/**"
914

1015
workflow_dispatch:
1116

@@ -15,7 +20,6 @@ permissions:
1520

1621
jobs:
1722
publish-container-image:
18-
1923
runs-on: ubuntu-latest
2024

2125
steps:
@@ -40,25 +44,25 @@ jobs:
4044

4145
- name: Set up Docker Buildx
4246
uses: docker/setup-buildx-action@v2
43-
47+
4448
- name: Login to GitHub Container Registry
45-
uses: docker/login-action@v1
49+
uses: docker/login-action@v1
4650
with:
4751
registry: ghcr.io
4852
username: ${{ github.actor }}
49-
password: ${{ github.token }}
50-
53+
password: ${{ github.token }}
54+
5155
- name: Build and push
5256
uses: docker/build-push-action@v2
5357
with:
5458
context: src/ai-service
5559
file: src/ai-service/Dockerfile
5660
platforms: linux/amd64,linux/arm64
57-
push: true
61+
push: ${{ github.event_name == 'push' }}
5862
tags: |
5963
${{ steps.set-variables.outputs.REPOSITORY }}/${{ steps.set-variables.outputs.IMAGE }}:latest
6064
${{ steps.set-variables.outputs.REPOSITORY }}/${{ steps.set-variables.outputs.IMAGE }}:${{ steps.set-variables.outputs.VERSION }}
6165
labels: |
6266
org.opencontainers.image.source=${{ github.repositoryUrl }}
6367
org.opencontainers.image.created=${{ steps.set-variables.outputs.CREATED }}
64-
org.opencontainers.image.revision=${{ steps.set-variables.outputs.VERSION }}
68+
org.opencontainers.image.revision=${{ steps.set-variables.outputs.VERSION }}

.github/workflows/package-makeline-service.yaml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
name: package-makeline-service
22

33
on:
4+
pull_request:
5+
branches:
6+
- "main"
7+
paths:
8+
- "src/makeline-service/**"
49
push:
510
branches:
6-
- 'main'
11+
- "main"
712
paths:
8-
- 'src/makeline-service/**'
13+
- "src/makeline-service/**"
914

1015
workflow_dispatch:
1116

@@ -15,7 +20,6 @@ permissions:
1520

1621
jobs:
1722
publish-container-image:
18-
1923
runs-on: ubuntu-latest
2024

2125
steps:
@@ -40,25 +44,25 @@ jobs:
4044

4145
- name: Set up Docker Buildx
4246
uses: docker/setup-buildx-action@v2
43-
47+
4448
- name: Login to GitHub Container Registry
45-
uses: docker/login-action@v1
49+
uses: docker/login-action@v1
4650
with:
4751
registry: ghcr.io
4852
username: ${{ github.actor }}
49-
password: ${{ github.token }}
50-
53+
password: ${{ github.token }}
54+
5155
- name: Build and push
5256
uses: docker/build-push-action@v2
5357
with:
5458
context: src/makeline-service
5559
file: src/makeline-service/Dockerfile
5660
platforms: linux/amd64,linux/arm64
57-
push: true
61+
push: ${{ github.event_name == 'push' }}
5862
tags: |
5963
${{ steps.set-variables.outputs.REPOSITORY }}/${{ steps.set-variables.outputs.IMAGE }}:latest
6064
${{ steps.set-variables.outputs.REPOSITORY }}/${{ steps.set-variables.outputs.IMAGE }}:${{ steps.set-variables.outputs.VERSION }}
6165
labels: |
6266
org.opencontainers.image.source=${{ github.repositoryUrl }}
6367
org.opencontainers.image.created=${{ steps.set-variables.outputs.CREATED }}
64-
org.opencontainers.image.revision=${{ steps.set-variables.outputs.VERSION }}
68+
org.opencontainers.image.revision=${{ steps.set-variables.outputs.VERSION }}

.github/workflows/package-order-service.yaml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
name: package-order-service
22

33
on:
4+
pull_request:
5+
branches:
6+
- "main"
7+
paths:
8+
- "src/order-service/**"
49
push:
510
branches:
6-
- 'main'
11+
- "main"
712
paths:
8-
- 'src/order-service/**'
13+
- "src/order-service/**"
914

1015
workflow_dispatch:
1116

@@ -15,7 +20,6 @@ permissions:
1520

1621
jobs:
1722
publish-container-image:
18-
1923
runs-on: ubuntu-latest
2024

2125
steps:
@@ -40,25 +44,25 @@ jobs:
4044

4145
- name: Set up Docker Buildx
4246
uses: docker/setup-buildx-action@v2
43-
47+
4448
- name: Login to GitHub Container Registry
45-
uses: docker/login-action@v1
49+
uses: docker/login-action@v1
4650
with:
4751
registry: ghcr.io
4852
username: ${{ github.actor }}
49-
password: ${{ github.token }}
50-
53+
password: ${{ github.token }}
54+
5155
- name: Build and push
5256
uses: docker/build-push-action@v2
5357
with:
5458
context: src/order-service
5559
file: src/order-service/Dockerfile
5660
platforms: linux/amd64,linux/arm64
57-
push: true
61+
push: ${{ github.event_name == 'push' }}
5862
tags: |
5963
${{ steps.set-variables.outputs.REPOSITORY }}/${{ steps.set-variables.outputs.IMAGE }}:latest
6064
${{ steps.set-variables.outputs.REPOSITORY }}/${{ steps.set-variables.outputs.IMAGE }}:${{ steps.set-variables.outputs.VERSION }}
6165
labels: |
6266
org.opencontainers.image.source=${{ github.repositoryUrl }}
6367
org.opencontainers.image.created=${{ steps.set-variables.outputs.CREATED }}
64-
org.opencontainers.image.revision=${{ steps.set-variables.outputs.VERSION }}
68+
org.opencontainers.image.revision=${{ steps.set-variables.outputs.VERSION }}

.github/workflows/package-product-service.yaml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
name: package-product-service
22

33
on:
4+
pull_request:
5+
branches:
6+
- "main"
7+
paths:
8+
- "src/product-service/**"
49
push:
510
branches:
6-
- 'main'
11+
- "main"
712
paths:
8-
- 'src/product-service/**'
13+
- "src/product-service/**"
914

1015
workflow_dispatch:
1116

@@ -15,7 +20,6 @@ permissions:
1520

1621
jobs:
1722
publish-container-image:
18-
1923
runs-on: ubuntu-latest
2024

2125
steps:
@@ -40,25 +44,25 @@ jobs:
4044

4145
- name: Set up Docker Buildx
4246
uses: docker/setup-buildx-action@v2
43-
47+
4448
- name: Login to GitHub Container Registry
45-
uses: docker/login-action@v1
49+
uses: docker/login-action@v1
4650
with:
4751
registry: ghcr.io
4852
username: ${{ github.actor }}
49-
password: ${{ github.token }}
50-
53+
password: ${{ github.token }}
54+
5155
- name: Build and push
5256
uses: docker/build-push-action@v2
5357
with:
5458
context: src/product-service
5559
file: src/product-service/Dockerfile
5660
platforms: linux/amd64,linux/arm64
57-
push: true
61+
push: ${{ github.event_name == 'push' }}
5862
tags: |
5963
${{ steps.set-variables.outputs.REPOSITORY }}/${{ steps.set-variables.outputs.IMAGE }}:latest
6064
${{ steps.set-variables.outputs.REPOSITORY }}/${{ steps.set-variables.outputs.IMAGE }}:${{ steps.set-variables.outputs.VERSION }}
6165
labels: |
6266
org.opencontainers.image.source=${{ github.repositoryUrl }}
6367
org.opencontainers.image.created=${{ steps.set-variables.outputs.CREATED }}
64-
org.opencontainers.image.revision=${{ steps.set-variables.outputs.VERSION }}
68+
org.opencontainers.image.revision=${{ steps.set-variables.outputs.VERSION }}

.github/workflows/package-store-admin.yaml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,25 @@
11
name: package-store-admin
22

33
on:
4+
pull_request:
5+
branches:
6+
- "main"
7+
paths:
8+
- "src/store-admin/**"
49
push:
510
branches:
6-
- 'main'
11+
- "main"
712
paths:
8-
- 'src/store-admin/**'
13+
- "src/store-admin/**"
914

1015
workflow_dispatch:
1116

1217
permissions:
1318
contents: read
1419
packages: write
15-
20+
1621
jobs:
1722
publish-container-image:
18-
1923
runs-on: ubuntu-latest
2024

2125
steps:
@@ -40,25 +44,25 @@ jobs:
4044

4145
- name: Set up Docker Buildx
4246
uses: docker/setup-buildx-action@v2
43-
47+
4448
- name: Login to GitHub Container Registry
45-
uses: docker/login-action@v1
49+
uses: docker/login-action@v1
4650
with:
4751
registry: ghcr.io
4852
username: ${{ github.actor }}
49-
password: ${{ github.token }}
50-
53+
password: ${{ github.token }}
54+
5155
- name: Build and push
5256
uses: docker/build-push-action@v2
5357
with:
5458
context: src/store-admin
5559
file: src/store-admin/Dockerfile
5660
platforms: linux/amd64,linux/arm64
57-
push: true
61+
push: ${{ github.event_name == 'push' }}
5862
tags: |
5963
${{ steps.set-variables.outputs.REPOSITORY }}/${{ steps.set-variables.outputs.IMAGE }}:latest
6064
${{ steps.set-variables.outputs.REPOSITORY }}/${{ steps.set-variables.outputs.IMAGE }}:${{ steps.set-variables.outputs.VERSION }}
6165
labels: |
6266
org.opencontainers.image.source=${{ github.repositoryUrl }}
6367
org.opencontainers.image.created=${{ steps.set-variables.outputs.CREATED }}
64-
org.opencontainers.image.revision=${{ steps.set-variables.outputs.VERSION }}
68+
org.opencontainers.image.revision=${{ steps.set-variables.outputs.VERSION }}

.github/workflows/package-store-front.yaml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,25 @@
11
name: package-store-front
22

33
on:
4+
pull_request:
5+
branches:
6+
- "main"
7+
paths:
8+
- "src/store-front/**"
49
push:
510
branches:
6-
- 'main'
11+
- "main"
712
paths:
8-
- 'src/store-front/**'
13+
- "src/store-front/**"
914

1015
workflow_dispatch:
1116

1217
permissions:
1318
contents: read
1419
packages: write
15-
20+
1621
jobs:
1722
publish-container-image:
18-
1923
runs-on: ubuntu-latest
2024

2125
steps:
@@ -40,25 +44,25 @@ jobs:
4044

4145
- name: Set up Docker Buildx
4246
uses: docker/setup-buildx-action@v2
43-
47+
4448
- name: Login to GitHub Container Registry
45-
uses: docker/login-action@v1
49+
uses: docker/login-action@v1
4650
with:
4751
registry: ghcr.io
4852
username: ${{ github.actor }}
49-
password: ${{ github.token }}
50-
53+
password: ${{ github.token }}
54+
5155
- name: Build and push
5256
uses: docker/build-push-action@v2
5357
with:
5458
context: src/store-front
5559
file: src/store-front/Dockerfile
5660
platforms: linux/amd64,linux/arm64
57-
push: true
61+
push: ${{ github.event_name == 'push' }}
5862
tags: |
5963
${{ steps.set-variables.outputs.REPOSITORY }}/${{ steps.set-variables.outputs.IMAGE }}:latest
6064
${{ steps.set-variables.outputs.REPOSITORY }}/${{ steps.set-variables.outputs.IMAGE }}:${{ steps.set-variables.outputs.VERSION }}
6165
labels: |
6266
org.opencontainers.image.source=${{ github.repositoryUrl }}
6367
org.opencontainers.image.created=${{ steps.set-variables.outputs.CREATED }}
64-
org.opencontainers.image.revision=${{ steps.set-variables.outputs.VERSION }}
68+
org.opencontainers.image.revision=${{ steps.set-variables.outputs.VERSION }}

0 commit comments

Comments
 (0)