-
Notifications
You must be signed in to change notification settings - Fork 3
44 lines (35 loc) · 1.62 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: Deploy to Heroku
on:
push:
branches:
- HW-166-add-tests-to-docker-container # Set this to the branch you want to trigger deployment
jobs:
deploy:
runs-on: ubuntu-latest
env:
HEROKU_EMAIL: ${{ secrets.HEROKU_EMAIL }}
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
HEROKU_APP_NAME_CLIENT: ${{ secrets.HEROKU_APP_NAME_CLIENT }}
HEROKU_APP_NAME_SERVER: ${{ secrets.HEROKU_APP_NAME_SERVER }}
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to Heroku Container Registry
run: |
echo "$HEROKU_API_KEY" | docker login --username="$HEROKU_EMAIL" --password-stdin registry.heroku.com
- name: Build and Push Client Image to Heroku Container Registry
run: |
docker build -t registry.heroku.com/${{ secrets.HEROKU_APP_NAME_CLIENT }}/web -f code/client/Dockerfile.production ./code
docker push registry.heroku.com/${{ secrets.HEROKU_APP_NAME_CLIENT }}/web
- name: Build and Push Server Image to Heroku Container Registry
run: |
docker build -t registry.heroku.com/${{ secrets.HEROKU_APP_NAME_SERVER }}/web -f code/server/Dockerfile.production ./code
docker push registry.heroku.com/${{ secrets.HEROKU_APP_NAME_SERVER }}/web
- name: Release Client on Heroku
run: |
heroku container:release web --app ${{ secrets.HEROKU_APP_NAME_CLIENT }}
- name: Release Server on Heroku
run: |
heroku container:release web --app ${{ secrets.HEROKU_APP_NAME_SERVER }}