-
Notifications
You must be signed in to change notification settings - Fork 1
32 lines (25 loc) · 900 Bytes
/
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
name: CI/CD to Heroku with Docker
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to Heroku Container Registry
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
run: echo $HEROKU_API_KEY | docker login --username=_ --password-stdin registry.heroku.com
- name: Build and push Docker image
run: |
docker buildx build --platform linux/amd64 --push -t registry.heroku.com/${{ secrets.HEROKU_APP_NAME }}/web .
- name: Release the Docker image
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
run: |
heroku container:release web -a ${{ secrets.HEROKU_APP_NAME }}