diff --git a/.github/workflows/backend-cd-prod-infra.yml b/.github/workflows/backend-cd-prod-infra.yml index 4b0919932..1bc277ab1 100644 --- a/.github/workflows/backend-cd-prod-infra.yml +++ b/.github/workflows/backend-cd-prod-infra.yml @@ -13,9 +13,9 @@ env: jobs: build-and-push: runs-on: ubuntu-latest - defaults: - run: - working-directory: backend +# defaults: +# run: +# working-directory: backend steps: - uses: actions/checkout@v4 @@ -43,6 +43,15 @@ jobs: with: report_paths: ${{ github.workspace }}/backend/build/test-results/**/*.xml + - name: Send docker-compose.yml + uses: appleboy/scp-action@master + with: + username: ubuntu + host: ${{ secrets.AWS_PROD_HOSTNAME }} + key: ${{ secrets.AWS_PROD_PRIVATE_KEY }} + source: "../../backend/docker-compose.yml" + target: "/home/ubuntu/" + - name: Setup Docker Buildx uses: docker/setup-buildx-action@v3 @@ -53,7 +62,7 @@ jobs: password: ${{ secrets.DOCKERHUB_PASSWORD }} - name: Docker Image Build And Push - run: docker build --platform linux/arm64 -t ${{ secrets.DOCKERHUB_USERNAME }}/$DOCKERHUB_REPOSITORY:${{ github.sha }}-dev -f Dockerfile . --push + run: docker build --platform linux/arm64 -t ${{ secrets.DOCKERHUB_USERNAME }}/$DOCKERHUB_REPOSITORY:${{ github.sha }}-prod_v2 -f Dockerfile . --push pull-and-deploy: needs: build-and-push diff --git a/backend/Dockerfile b/backend/Dockerfile index 489d00862..bcb090d79 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -2,7 +2,7 @@ FROM openjdk:17-jdk ARG JAR_FILE=./build/libs/ody-backend-0.0.1-SNAPSHOT.jar -ENV SPRING_PROFILES_ACTIVE=dev +ENV SPRING_PROFILES_ACTIVE=prod ENV JASYPT_ENCRYPTOR_PASSWORD=${JASYPT_ENCRYPTOR_PASSWORD} COPY ${JAR_FILE} ody-backend.jar