-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added GitHub action for Deploy Docker image to Heroku
- Loading branch information
Showing
2 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
.github/workflows/build-push-and-deploy-ngx-ramblers-docker-image-via-heroku.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Deploy Docker image to Heroku | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Log in to Heroku container registry | ||
run: | | ||
echo "${{ secrets.HEROKU_API_KEY }}" | docker login --username= "${{ secrets.DOCKER_USERNAME }}" --password-stdin registry.heroku.com | ||
- name: Pull Docker image from Docker Hub | ||
run: | | ||
docker pull nbarrett36/ngx-ramblers:latest | ||
- name: Tag Docker image for Heroku | ||
run: | | ||
docker tag nbarrett36/ngx-ramblers:latest registry.heroku.com/ngx-ramblers-docker/web | ||
- name: Push Docker image to Heroku | ||
run: | | ||
docker push registry.heroku.com/ngx-ramblers-docker/web | ||
- name: Release Docker image on Heroku | ||
run: | | ||
heroku container:release web --app ngx-ramblers-docker | ||
env: | ||
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# heroku.yml | ||
build: | ||
docker: | ||
web: Dockerfile | ||
|
||
run: | ||
web: docker run -d -p $PORT:$PORT nbarrett36/ngx-ramblers:latest |