Skip to content

Commit

Permalink
Testing Multi-Platform Build - Try #1
Browse files Browse the repository at this point in the history
  • Loading branch information
RawSanj committed Dec 22, 2023
1 parent fe268b9 commit dd1bf1a
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/multi-platform-docker-image.yml
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

0 comments on commit dd1bf1a

Please sign in to comment.