|
|
@@ -26,14 +26,45 @@ jobs:
|
|
|
needs: build-and-test
|
|
|
runs-on: ubuntu-latest
|
|
|
steps:
|
|
|
+ - uses: actions/checkout@v3
|
|
|
+ - name: Set up Docker Buildx
|
|
|
+ uses: docker/setup-buildx-action@v1
|
|
|
+ - name: Set up JDK
|
|
|
+ uses: actions/setup-java@v3
|
|
|
+ with:
|
|
|
+ java-version: '21'
|
|
|
+ distribution: 'temurin'
|
|
|
+ - name: Build the Docker image
|
|
|
+ run: ./gradlew build && docker build -t lhamacorp/stocks-be .
|
|
|
+ - name: Login to Docker Hub
|
|
|
+ uses: docker/login-action@v2
|
|
|
+ with:
|
|
|
+ username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
+ password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
+ - name: Push image
|
|
|
+ run: docker push lhamacorp/stocks-be
|
|
|
+
|
|
|
+ dockerize-arm:
|
|
|
+ name: Dockerize ARM Application
|
|
|
+ needs: build-and-test
|
|
|
+ runs-on: ubuntu-latest
|
|
|
+ steps:
|
|
|
+ - uses: actions/checkout@v3
|
|
|
+ - name: Set up JDK
|
|
|
+ uses: actions/setup-java@v3
|
|
|
+ with:
|
|
|
+ java-version: '21'
|
|
|
+ distribution: 'temurin'
|
|
|
+ - name: Build
|
|
|
+ run: ./gradlew build
|
|
|
- name: Set up Docker Buildx
|
|
|
uses: docker/setup-buildx-action@v2
|
|
|
- - name: Log in to Docker Hub
|
|
|
+ - name: Login to Docker Hub
|
|
|
uses: docker/login-action@v2
|
|
|
with:
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
- - name: Build and push multi-platform Docker images
|
|
|
+ - name: Build and Push ARM Image
|
|
|
run: |
|
|
|
docker buildx create --use
|
|
|
- docker buildx build --platform linux/amd64,linux/arm64 -t lhamacorp/stocks-be:latest . --push
|
|
|
+ docker buildx build --platform linux/arm64 -t lhamacorp/stocks-be:latest --push .
|