-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adjustments to build the image with dockerfile
- Loading branch information
Showing
1 changed file
with
10 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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' | ||
|
||
|
@@ -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 |