Skip to content

Commit

Permalink
Use context during build to match Dockerfile expectations
Browse files Browse the repository at this point in the history
  • Loading branch information
joecorall authored Apr 30, 2024
1 parent 437ad3e commit d41b74f
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,13 @@ jobs:
# aka base build
if [ ${{ inputs.dockerFile }} == "Dockerfile" ]; then
echo "image=scyllaridae" >> $GITHUB_OUTPUT
echo "context=." >> $GITHUB_OUTPUT
exit 0
fi
# put the YML file in place so it's copied into the Docker container
DIR=$(dirname "${{ inputs.dockerFile }}")
cp ./$DIR/scyllaridae.yml .
# name the docker image after the folder name prefixed by scyllaridae
# e.g. scyllaridae-curl
echo "image=scyllaridae-$(basename $DIR)" >> $GITHUB_OUTPUT
echo "context=$DIR" >> $GITHUB_OUTPUT
id: setup

- id: 'auth'
Expand All @@ -71,8 +69,7 @@ jobs:
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: ${{ inputs.dockerFile }}
context: ${{steps.setup.outputs.context}}
build-args: |
TAG=${{steps.extract_branch.outputs.branch}}
DOCKER_REPOSITORY=us-docker.pkg.dev/${{ secrets.GCLOUD_PROJECT }}/public
Expand Down

0 comments on commit d41b74f

Please sign in to comment.