|
|
@@ -34,68 +34,14 @@ jobs:
|
|
|
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: Login to Docker Hub
|
|
|
+ - name: Log in to Docker Hub
|
|
|
uses: docker/login-action@v2
|
|
|
with:
|
|
|
- username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
- password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
- - name: Build and Push ARM Image
|
|
|
+ username: ${{ secrets.DOCKER_USERNAME }}
|
|
|
+ password: ${{ secrets.DOCKER_TOKEN }}
|
|
|
+ - name: Build and push multi-platform Docker images
|
|
|
run: |
|
|
|
docker buildx create --use
|
|
|
- docker buildx build --platform linux/arm64 -t lhamacorp/stocks-be:arm-latest --push .
|
|
|
-
|
|
|
-# deploy:
|
|
|
-# name: Deploy to Server
|
|
|
-# needs: dockerize
|
|
|
-# runs-on: ubuntu-latest
|
|
|
-# steps:
|
|
|
-# - name: Deploy to Server
|
|
|
-# uses: appleboy/ssh-action@master
|
|
|
-# with:
|
|
|
-# host: ${{ secrets.NEPTUNE_SERVER_IP }}
|
|
|
-# username: ${{ secrets.SERVER_USER }}
|
|
|
-# key: ${{ secrets.SSH_PRIVATE_KEY }}
|
|
|
-# script: |
|
|
|
-# docker pull lhamacorp/stocks-be:latest
|
|
|
-# docker stop stocks-be || true
|
|
|
-# docker rm stocks-be || true
|
|
|
-# docker run -d --name stocks-be -p 42902:8080 -e mongo=${{ secrets.MONGO }} -e database=${{ secrets.DATABASE }} -e stock_provider=${{ secrets.STOCK_PROVIDER_URL }} -e stock_key=${{ secrets.STOCK_PROVIDER_KEY }} -e exchange_provider=${{ secrets.EXCHANGE_PROVIDER_URL }} -e exchange_key=${{ secrets.EXCHANGE_PROVIDER_KEY }} lhamacorp/stocks-be:latest
|
|
|
-#
|
|
|
-# cleanup:
|
|
|
-# name: Clean ups
|
|
|
-# needs: deploy
|
|
|
-# runs-on: ubuntu-latest
|
|
|
-# steps:
|
|
|
-# - name: Clean up Server
|
|
|
-# uses: appleboy/ssh-action@master
|
|
|
-# with:
|
|
|
-# host: ${{ secrets.NEPTUNE_SERVER_IP }}
|
|
|
-# username: ${{ secrets.SERVER_USER }}
|
|
|
-# key: ${{ secrets.SSH_PRIVATE_KEY }}
|
|
|
-# script: |
|
|
|
-# docker image prune -a -f
|
|
|
+ docker buildx build --platform linux/amd64,linux/arm64 -t lhamacorp/stocks-be:latest . --push
|