feat: year 2 dashboard updates #97
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
# Deployed to https://staging.api.fairhub.io | |
name: (staging) Build and push api image to Azure Container Registry | |
on: | |
push: | |
branches: | |
- staging | |
pull_request: | |
types: [closed] | |
branches: | |
- staging | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
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: | |
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: Wait for linting to pass | |
uses: lewagon/[email protected] | |
with: | |
ref: staging | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
check-name: "Run linters (3.10)" | |
- name: Wait for tests to pass | |
uses: lewagon/[email protected] | |
with: | |
ref: staging | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
check-name: "Run tests (3.10)" | |
- 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: Get GitHub short SHA | |
id: git_sha | |
run: echo ::set-output name=sha::$(git rev-parse --short ${{ github.sha }}) | |
- 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-api:staging,${{ secrets.AZURE_REGISTRY_LOGIN_SERVER }}/fairhub-api:${{ steps.git_sha.outputs.sha }} |