Skip to content

Commit

Permalink
- move all docker build steps to single workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
nbarrett committed Sep 2, 2024
1 parent 421ce73 commit 87e3e0d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy Docker image to Heroku
name: Deploy and Build Docker Image and release to Heroku

on:
push:
Expand All @@ -13,29 +13,30 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Log in to Docker Hub
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
- name: Build the Docker image
run: |
docker build . --file Dockerfile --tag ngx-ramblers:latest
- name: Tag the Docker image
run: docker tag ngx-ramblers:latest ${{ secrets.DOCKER_USERNAME }}/ngx-ramblers:latest
- name: Push the Docker image to Docker Hub
run: docker push ${{ secrets.DOCKER_USERNAME }}/ngx-ramblers:latest
- name: Install Heroku CLI
run: |
curl https://cli-assets.heroku.com/install.sh | sh
- name: Log in to Heroku container registry
run: |
echo "${{ secrets.HEROKU_API_KEY }}" | docker login --username="${{ secrets.HEROKU_EMAIL }}" --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 }}
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
name: Build and Deploy NGX-Ramblers Docker Image

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:
runs-on: ubuntu-latest
Expand Down

0 comments on commit 87e3e0d

Please sign in to comment.