Skip to content

Update prod (#323) #227

Update prod (#323)

Update prod (#323) #227

name: Build and push docker image
on: [push]
env:
DOCKER_REPO: ${{ secrets.DOCKER_USERNAME }}/hawk-workers
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push production image
if: endsWith(github.ref, '/prod')
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
tags: ${{ env.DOCKER_REPO }}:prod
push: ${{ endsWith(github.ref, '/prod') }}
- name: Build and push stage image
if: endsWith(github.ref, '/stage')
uses: docker/build-push-action@v2
with:
context: .
file: ./stage.Dockerfile
tags: ${{ env.DOCKER_REPO }}:stage
push: ${{ endsWith(github.ref, '/stage') }}
- name: Build and push migration image
if: endsWith(github.ref, '/migration')
uses: docker/build-push-action@v2
with:
context: .
file: ./stage.Dockerfile
tags: ${{ env.DOCKER_REPO }}:migration
push: ${{ endsWith(github.ref, '/migration') }}