Skip to content

Commit a09162e

Browse files
committed
deploy PROD to Heroku
1 parent 896a73c commit a09162e

File tree

2 files changed

+7
-57
lines changed

2 files changed

+7
-57
lines changed

.github/workflows/build-docker-and-deploy-to-dev.yml

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,8 @@ name: Build Docker Image and Deploy to DEV
77
jobs:
88
test:
99
uses: remotemobprogramming/timer/.github/workflows/test.yml@main
10-
dockerbuild:
11-
needs: test
12-
runs-on: ubuntu-latest
13-
steps:
14-
- uses: actions/checkout@v3
15-
- name: Setup Java JDK
16-
uses: actions/setup-java@v3.5.1
17-
with:
18-
distribution: 'temurin'
19-
java-version: '17'
20-
- name: Login to DockerHub
21-
uses: docker/login-action@v2
22-
with:
23-
username: ${{ secrets.DOCKERHUB_USERNAME }}
24-
password: ${{ secrets.DOCKERHUB_TOKEN }}
25-
- name: Docker Build
26-
run: ./mvnw spring-boot:build-image
27-
- name: Docker Tag
28-
run: docker tag remotemobprogramming/mob-timer remotemobprogramming/mob-timer:${{ github.sha }}
29-
- name: Docker Push Latest
30-
run: docker push remotemobprogramming/mob-timer:latest
31-
- name: Docker Push Tag
32-
run: docker push remotemobprogramming/mob-timer:${{ github.sha }}
3310
deployment:
34-
needs: dockerbuild
11+
needs: test
3512
environment: development
3613
concurrency: development
3714
runs-on: ubuntu-latest

.github/workflows/release.yml

Lines changed: 6 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -5,42 +5,15 @@ name: Release
55
jobs:
66
test:
77
uses: remotemobprogramming/timer/.github/workflows/test.yml@main
8-
dockerbuild:
9-
needs: test
10-
runs-on: ubuntu-latest
11-
steps:
12-
- uses: actions/checkout@v3
13-
- name: Setup Java JDK
14-
uses: actions/setup-java@v3.5.1
15-
with:
16-
distribution: 'temurin'
17-
java-version: '17'
18-
- name: Login to DockerHub
19-
uses: docker/login-action@v2
20-
with:
21-
username: ${{ secrets.DOCKERHUB_USERNAME }}
22-
password: ${{ secrets.DOCKERHUB_TOKEN }}
23-
- name: Docker Build
24-
run: ./mvnw spring-boot:build-image
25-
- name: Docker Tag
26-
run: docker tag remotemobprogramming/mob-timer remotemobprogramming/mob-timer:${{ github.sha }}
27-
- name: Docker Push Latest
28-
run: docker push remotemobprogramming/mob-timer:latest
29-
- name: Docker Push Tag
30-
run: docker push remotemobprogramming/mob-timer:${{ github.sha }}
318
deployment:
32-
needs: dockerbuild
9+
needs: test
3310
environment: production
3411
concurrency: production
3512
runs-on: ubuntu-latest
3613
steps:
37-
- name: deploy
38-
uses: appleboy/ssh-action@v0.1.5
14+
- uses: actions/checkout@v3
15+
- uses: akhileshns/heroku-deploy@v3.12.13
3916
with:
40-
host: ${{ secrets.SSH_HOST_PROD }}
41-
username: ${{ secrets.SSH_USERNAME }}
42-
key: ${{ secrets.SSH_KEY }}
43-
script: |
44-
docker stop mobtimer
45-
docker rm mobtimer
46-
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 }}
17+
heroku_api_key: ${{secrets.HEROKU_AUTH_TOKEN}}
18+
heroku_app_name: ${{ secrets.HEROKU_APP_NAME_PROD }}
19+
heroku_email: ${{ secrets.HEROKU_EMAIL }}

0 commit comments

Comments
 (0)