Skip to content

Commit

Permalink
Update build and push for chaining
Browse files Browse the repository at this point in the history
  • Loading branch information
halostatue committed Mar 27, 2023
1 parent eeaec91 commit aa614d7
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions .github/workflows/build-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ on:
pull_request:
branches:
- 'main'
workflow_dispatch:
workflow_call:

jobs:
Expand All @@ -20,13 +19,19 @@ jobs:
- uses: actions/checkout@v3

- uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0
if: github.event_name == 'release'
if: >-
github.event_name == 'workflow_call' ||
github.event_name == 'push' ||
github.event_name == 'workflow_dispatch'
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0
if: github.event_name == 'release'
if: >-
github.event_name == 'workflow_call' ||
github.event_name == 'push' ||
github.event_name == 'workflow_dispatch'
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
Expand Down Expand Up @@ -57,7 +62,12 @@ jobs:
- id: docker_build
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 # v4.0.0
with:
push: ${{ github.event_name == 'release' }}
push: >-
${{
github.event_name == 'workflow_call' ||
github.event_name == 'push' ||
github.event_name == 'workflow_dispatch'
}}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
Expand All @@ -72,7 +82,10 @@ jobs:
cache-to: type=gha,mode=max

- uses: peter-evans/dockerhub-description@202973a37c8a723405c0c5f0a71b6d99db470dae # v3.3.0
if: github.event_name == 'release'
if: >-
github.event_name == 'workflow_call' ||
github.event_name == 'push' ||
github.event_name == 'workflow_dispatch'
with:
repository: kineticcafe/sqitch-pgtap
username: ${{ secrets.DOCKERHUB_USERNAME }}
Expand Down

0 comments on commit aa614d7

Please sign in to comment.