Update buildpacks/github-actions action to v5 #176
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
name: build | |
on: [push] | |
jobs: | |
build-with-maven-push-2-ghcr: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up JDK 15 | |
uses: actions/setup-java@v2 | |
with: | |
distribution: 'adopt' | |
java-version: 15 | |
- name: Login to GitHub Container Registry | |
run: echo $CR_PAT | docker login ghcr.io -u jonashackt --password-stdin | |
env: | |
CR_PAT: ${{ secrets.CR_PAT }} | |
- name: Build a container image from our Spring Boot app using Paketo.io / Cloud Native Build Packs | |
run: mvn spring-boot:build-image --batch-mode --no-transfer-progress | |
- name: Tag & publish to GitHub Container Registry | |
run: | | |
docker tag spring-boot-buildpack:0.0.1-SNAPSHOT ghcr.io/jonashackt/spring-boot-buildpack:latest | |
docker push ghcr.io/jonashackt/spring-boot-buildpack:latest | |
build-with-paketo-push-2-dockerhub: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Login to DockerHub Container Registry | |
run: echo $DOCKER_HUB_TOKEN | docker login -u jonashackt --password-stdin | |
env: | |
DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_TOKEN }} | |
- name: Install pack CLI via the official buildpack Action https://github.com/buildpacks/github-actions#setup-pack-cli-action | |
uses: buildpacks/github-actions/setup-pack@v5.6.0 | |
- 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/jonashackt/spring-boot-buildpack:latest \ | |
--builder paketobuildpacks/builder:base \ | |
--path . \ | |
--cache-image index.docker.io/jonashackt/spring-boot-buildpack-paketo-cache-image:latest \ | |
--publish |