diff --git a/.github/workflows/build-docker-and-deploy-to-dev.yml b/.github/workflows/build-docker-and-deploy-to-dev.yml index 5760236..47dab89 100644 --- a/.github/workflows/build-docker-and-deploy-to-dev.yml +++ b/.github/workflows/build-docker-and-deploy-to-dev.yml @@ -7,31 +7,8 @@ name: Build Docker Image and Deploy to DEV jobs: test: uses: remotemobprogramming/timer/.github/workflows/test.yml@main - dockerbuild: - needs: test - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Setup Java JDK - uses: actions/setup-java@v3.5.1 - with: - distribution: 'temurin' - java-version: '17' - - name: Login to DockerHub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Docker Build - run: ./mvnw spring-boot:build-image - - name: Docker Tag - run: docker tag remotemobprogramming/mob-timer remotemobprogramming/mob-timer:${{ github.sha }} - - name: Docker Push Latest - run: docker push remotemobprogramming/mob-timer:latest - - name: Docker Push Tag - run: docker push remotemobprogramming/mob-timer:${{ github.sha }} deployment: - needs: dockerbuild + needs: test environment: development concurrency: development runs-on: ubuntu-latest diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index aa408f2..f259d3c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,42 +5,15 @@ name: Release jobs: test: uses: remotemobprogramming/timer/.github/workflows/test.yml@main - dockerbuild: - needs: test - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Setup Java JDK - uses: actions/setup-java@v3.5.1 - with: - distribution: 'temurin' - java-version: '17' - - name: Login to DockerHub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Docker Build - run: ./mvnw spring-boot:build-image - - name: Docker Tag - run: docker tag remotemobprogramming/mob-timer remotemobprogramming/mob-timer:${{ github.sha }} - - name: Docker Push Latest - run: docker push remotemobprogramming/mob-timer:latest - - name: Docker Push Tag - run: docker push remotemobprogramming/mob-timer:${{ github.sha }} deployment: - needs: dockerbuild + needs: test environment: production concurrency: production runs-on: ubuntu-latest steps: - - name: deploy - uses: appleboy/ssh-action@v0.1.5 + - uses: actions/checkout@v3 + - uses: akhileshns/heroku-deploy@v3.12.13 with: - host: ${{ secrets.SSH_HOST_PROD }} - username: ${{ secrets.SSH_USERNAME }} - key: ${{ secrets.SSH_KEY }} - script: | - docker stop mobtimer - docker rm mobtimer - docker run -d -e VIRTUAL_HOST=timer.mob.sh -e LETSENCRYPT_HOST=timer.mob.sh -e LETSENCRYPT_EMAIL=team@mob.sh -e PORT=80 --expose 80 --network=proxy --pull always --name mobtimer remotemobprogramming/mob-timer:${{ github.sha }} \ No newline at end of file + heroku_api_key: ${{secrets.HEROKU_AUTH_TOKEN}} + heroku_app_name: ${{ secrets.HEROKU_APP_NAME_PROD }} + heroku_email: ${{ secrets.HEROKU_EMAIL }} \ No newline at end of file