Skip to content

Commit

Permalink
Adjustments to build the image with dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
365Bit committed Jun 16, 2024
1 parent a51e96a commit 2408a3a
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions .github/workflows/buildAndPushImage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,20 @@ on:
push:
branches:
- 'main'
- 'dev'
pull_request:
branches:
- 'main'

env:
IMAGE_NAME: layout-pipeline
IMAGE_TAG: ${{ github.ref == 'refs/heads/main' && 'latest' || 'testing' }}

jobs:
build-with-paketo-push-2-dockerhub:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: 'true'

Expand All @@ -21,16 +26,8 @@ jobs:
env:
DOCKER_HUB_TOKEN: ${{ secrets.DOCKERHUBTOKEN }}

- name: Install pack CLI via the official buildpack Action https://github.com/buildpacks/github-actions#setup-pack-cli-action
uses: buildpacks/github-actions/[email protected]
- name: Build the Docker image
run: docker build . --file Dockerfile --tag 365bit/$IMAGE_NAME:$IMAGE_TAG

- name: Build app with pack CLI using Buildpack Cache image (see https://buildpacks.io/docs/app-developer-guide/using-cache-image/) & publish to Docker Hub
run: |
pack build index.docker.io/365bit/$IMAGE_NAME:latest \
--builder paketobuildpacks/builder:base \
--path . \
--env BP_INCLUDE_FILES="src/*" \
--env BP_JVM_VERSION=17 \
--env BPL_JAVA_NMT_ENABLED=false \
--cache-image index.docker.io/365bit/$IMAGE_NAME-paketo-cache-image:latest \
--publish
- name: Push the Docker image
run: docker push 365bit/$IMAGE_NAME:$IMAGE_TAG

0 comments on commit 2408a3a

Please sign in to comment.