Skip to content

Commit ae74bc0

Browse files
committed
feat: build on pull request as well as release
This change: - adds "pull_request" as an event that will trigger the workflow. - marks the "docker login" step as conditional, only to run on release. - alters the "Build and push" step such that the "push" value will be based on whether or not this is for a release. Signed-off-by: Matthew Weier O'Phinney <[email protected]>
1 parent e0e8146 commit ae74bc0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

.github/workflows/build-and-push-containers.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name: Build and push containers
33
on:
44
release:
55
types: [published]
6+
pull_request:
67

78
jobs:
89
release-container:
@@ -28,6 +29,7 @@ jobs:
2829
uses: docker/setup-buildx-action@v1
2930

3031
- name: Login to GitHub Container Registry
32+
if: ${{ github.event_name == 'release' }}
3133
uses: docker/login-action@v1
3234
with:
3335
registry: ghcr.io
@@ -41,7 +43,7 @@ jobs:
4143
file: ./Dockerfile
4244
platforms: linux/amd64
4345
pull: true
44-
push: true
46+
push: ${{ github.event_name == 'release' }}
4547
tags: ${{ join(fromJSON(steps.tags.outputs.tags), ',') }}
4648
cache-from: type=registry,ref=ghcr.io/laminas/laminas-continuous-integration-action:build-cache
4749
cache-to: type=registry,ref=ghcr.io/laminas/laminas-continuous-integration-action:build-cache,mode=max

0 commit comments

Comments
 (0)