-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Testing Multi-Platform Build - Try #1
- Loading branch information
Showing
1 changed file
with
45 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: DockerHub | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
env: | ||
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Build and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
platforms: linux/amd64,linux/arm64 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 17 | ||
|
||
- name: Build Docker Image with Maven | ||
run: mvn spring-boot:build-image --file pom.xml | ||
|
||
- name: Set Image Tag Version | ||
run: echo "TAG_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV | ||
|
||
- name: Tag Image | ||
run: docker tag rawsanj/spring-redis-websocket:${{ env.TAG_VERSION }}-webflux rawsanj/spring-redis-websocket:latest | ||
|
||
- name: Login to DockerHub Registry | ||
run: echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin | ||
|
||
- name: Push Image to DockerHub | ||
run: docker push rawsanj/spring-redis-websocket:latest && docker push rawsanj/spring-redis-websocket:${{ env.TAG_VERSION }}-webflux |