Skip to content

👷 ci: deploy api to Azure Container Registry (#25) #5

👷 ci: deploy api to Azure Container Registry (#25)

👷 ci: deploy api to Azure Container Registry (#25) #5

Workflow file for this run

name: Build and push Docker image to Azure Container Registry (staging)
on:
push:
branches:
- staging
pull_request:
types: [closed]
branches:
- staging
workflow_dispatch:
jobs:
build:
name: Build and push Docker image
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.merged == true)
runs-on: ubuntu-latest
env:
FAIRHUB_DATABASE_URL: ${{ secrets.FAIRHUB_STAGING_DATABASE_URL }}
AZURE_REGISTRY_LOGIN_SERVER: ${{ secrets.AZURE_REGISTRY_LOGIN_SERVER }}
AZURE_REGISTRY_USERNAME: ${{ secrets.AZURE_REGISTRY_USERNAME }}
AZURE_REGISTRY_PASSWORD: ${{ secrets.AZURE_REGISTRY_PASSWORD }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Login to Azure Container Registry
uses: azure/docker-login@v1
with:
login-server: ${{ secrets.AZURE_REGISTRY_LOGIN_SERVER }}
username: ${{ secrets.AZURE_REGISTRY_USERNAME }}
password: ${{ secrets.AZURE_REGISTRY_PASSWORD }}
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ secrets.AZURE_REGISTRY_LOGIN_SERVER }}/fairhub:staging