Skip to content

Commit

Permalink
deploy PROD to Heroku
Browse files Browse the repository at this point in the history
  • Loading branch information
hollesse committed Mar 15, 2023
1 parent 896a73c commit a09162e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 57 deletions.
25 changes: 1 addition & 24 deletions .github/workflows/build-docker-and-deploy-to-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
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
Expand Down
39 changes: 6 additions & 33 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
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/[email protected]
- uses: actions/checkout@v3
- uses: akhileshns/[email protected]
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 [email protected] -e PORT=80 --expose 80 --network=proxy --pull always --name mobtimer remotemobprogramming/mob-timer:${{ github.sha }}
heroku_api_key: ${{secrets.HEROKU_AUTH_TOKEN}}
heroku_app_name: ${{ secrets.HEROKU_APP_NAME_PROD }}
heroku_email: ${{ secrets.HEROKU_EMAIL }}

0 comments on commit a09162e

Please sign in to comment.