Skip to content

Commit

Permalink
GitHub workflow to push images to Azure Container Registry (#138)
Browse files Browse the repository at this point in the history
* CI/CD: Azure Container Workflow

* chore: update the workflow
  • Loading branch information
SanjaySinghRajpoot authored and HarshCasper committed Jun 23, 2022
1 parent d461ec6 commit 626a2cb
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/push-to-azure.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Deploy to Azure Container Registry

on: [push]

env:
REGISTRY: mojaglobal.azurecr.io

jobs:
deploy-rest-api-flint-example:
name: Build and push REST API FLINT Example to ACR
runs-on: ubuntu-latest
steps:
- name: 'Checkout GitHub Action'
uses: actions/checkout@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: 'Login via Azure CLI'
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}

- name: 'Build and push image'
uses: azure/docker-login@v1
with:
login-server: ${{ env.REGISTRY }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}

- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/moja-global/rest_api_flint_example

- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: ./local/rest_api_flint.example/
file: "./local/rest_api_flint.example/Dockerfile"
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"makefile.extensionOutputFolder": "./.vscode",
"esbonio.sphinx.confDir": ""
}

0 comments on commit 626a2cb

Please sign in to comment.