Skip to content

Commit

Permalink
inspect image on push
Browse files Browse the repository at this point in the history
  • Loading branch information
juliangut committed Oct 22, 2023
1 parent 9aa9176 commit 7a1a0b5
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Docker images build and push

on:
push:
branches:
- master
tags:
- '*'
pull_request:
Expand Down Expand Up @@ -88,18 +90,18 @@ jobs:
BUILD_DATE=${{ needs.prepare_env.outputs.build_date }}
VCS_REF=${{ needs.prepare_env.outputs.vcs_ref }}
XDEBUG_VERSION=${{ matrix.builds.xdebug }}
if: ${{ github.event_name == 'pull_request' }}
if: ${{ github.ref_type == 'branch' }}

- name: Inspect image
run: docker image inspect juliangut/phpdev:test
if: ${{ github.event_name == 'pull_request' }}
if: ${{ github.ref_type == 'branch' }}

- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
if: ${{ github.event_name != 'pull_request' }}
if: ${{ github.ref_type == 'tag' }}

- name: Build and push
uses: docker/build-push-action@v3
Expand All @@ -113,10 +115,10 @@ jobs:
BUILD_DATE=${{ needs.prepare_env.outputs.build_date }}
VCS_REF=${{ needs.prepare_env.outputs.vcs_ref }}
XDEBUG_VERSION=${{ matrix.builds.xdebug }}
if: ${{ github.event_name != 'pull_request' }}
if: ${{ github.ref_type == 'tag' }}

post_build:
if: ${{ github.event_name != 'pull_request' }}
if: ${{ github.ref_type == 'tag' }}

needs: build

Expand Down

0 comments on commit 7a1a0b5

Please sign in to comment.