diff --git a/.github/workflows/dockerfile_workflow_test.yaml b/.github/workflows/dockerfile_workflow_test.yaml index e8173a2..390d7cf 100644 --- a/.github/workflows/dockerfile_workflow_test.yaml +++ b/.github/workflows/dockerfile_workflow_test.yaml @@ -1,6 +1,16 @@ +# +# This workflow is used to test the `reusable_dockerfile_pipeline` action used +# to build and push the Docker image to the container registries. +# +# The reason this workflow targets the develop branch is so that we can test the +# action in the PR. If we targeted main, we would need to merge changes into main +# before being able to test them. +# name: Build Using Reusable Workflow on: [push, pull_request] jobs: + # reusable-build tests calling the reusable_dockerfile_pipeline while + # providing a custom packageName reusable-build: permissions: contents: write @@ -10,6 +20,9 @@ jobs: dockerfile: docker-action-test/Dockerfile packageName: docker-test secrets: inherit + + # reusable-build-defaults tests calling the reusable_dockerfile_pipeline with + # the defaults reusable-build-defaults: permissions: contents: write diff --git a/.github/workflows/reusable_dockerfile_pipeline.yml b/.github/workflows/reusable_dockerfile_pipeline.yml index acab2db..1a1da6c 100644 --- a/.github/workflows/reusable_dockerfile_pipeline.yml +++ b/.github/workflows/reusable_dockerfile_pipeline.yml @@ -141,7 +141,7 @@ jobs: - name: Checkout uses: "actions/checkout@v4" - - name: Build and Push + - name: Build uses: docker/build-push-action@v5 env: OUTPUT_SHORT_SHA: ${{ needs.prepare-env.outputs.output_short_sha }} @@ -206,7 +206,7 @@ jobs: steps: - name: Check run conditions id: run_check - # We only want to run when the registry is able to run on pr or if it is a merge event + # We only want to run when the registry is able to run on PR or if it is a merge event run: echo "run=${{ matrix.registry.run-on-pr == needs.prepare-env.outputs.build_for_pr || needs.prepare-env.outputs.build_for_merge == 'true'}}" >> "$GITHUB_OUTPUT" - name: Checkout