Skip to content

I added docker login since I'm using docker-compose #85

I added docker login since I'm using docker-compose

I added docker login since I'm using docker-compose #85

Workflow file for this run

name: Deploy to Heroku
on:
push:
branches:
- HW-166-add-tests-to-docker-container # Branch to trigger deployment
jobs:
deploy:
runs-on: ubuntu-latest
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
HEROKU_EMAIL: ${{ secrets.HEROKU_EMAIL }}
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
HEROKU_APP_NAME: ${{ secrets.HEROKU_APP_NAME }} # Your Heroku app name
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to Docker Hub
run: |
echo "${{ secrets.DOCKER_PASSWORD }}" | docker login --username "${{ secrets.DOCKER_USERNAME }}" --password-stdin
- name: Log in to Heroku Container Registry
run: |
echo "$HEROKU_API_KEY" | docker login --username="$HEROKU_EMAIL" --password-stdin registry.heroku.com
- name: Build Images Using Docker Compose
run: |
docker-compose -f code/docker-compose-production.yml build
- name: Tag and Push API Image to Heroku Container Registry
run: |
docker tag api-production:latest registry.heroku.com/${{ env.HEROKU_APP_NAME }}/web
docker push registry.heroku.com/${{ env.HEROKU_APP_NAME }}/web
- name: Tag and Push Client Image to Heroku Container Registry
run: |
docker tag client-production:latest registry.heroku.com/${{ env.HEROKU_APP_NAME }}/web
docker push registry.heroku.com/${{ env.HEROKU_APP_NAME }}/web
- name: Release on Heroku
run: |
heroku container:release web --app ${{ env.HEROKU_APP_NAME }}