Skip to content

Commit

Permalink
Merge branch 'staging' of github.com:AI-READI/fairhub-api into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
greenstick committed Apr 16, 2024
2 parents 93d4ac9 + 216df4a commit 5a2f196
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build-and-deploy-to-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
name: (main) Build and push api image to Azure Container Registry

on:
push:
branches:
- main
pull_request:
types: [closed]
branches:
Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/staging-build-and-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
on:
# push:
# branches:
# - staging
# pull_request:
# types: [opened, synchronize, reopened, closed]
# branches:
# - staging
workflow_dispatch:

name: Staging_Container_Workflow

jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
# checkout the repo
- name: "Checkout GitHub Action"
uses: actions/checkout@v4
with:
ref: staging

- 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: ${{ secrets.REGISTRY_LOGIN_SERVER }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- run: |
docker build . -t ${{ secrets.REGISTRY_LOGIN_SERVER }}/fairhub-flask-api:staging${{ github.sha }}
docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/fairhub-flask-api:staging${{ github.sha }}
- name: "Deploy to Azure Container Instances"
uses: "azure/aci-deploy@v1"
with:
resource-group: ${{ secrets.RESOURCE_GROUP }}
dns-name-label: ${{ secrets.RESOURCE_GROUP }}${{ github.run_number }}
image: ${{ secrets.REGISTRY_LOGIN_SERVER }}/sampleapp:${{ github.sha }}
registry-login-server: ${{ secrets.REGISTRY_LOGIN_SERVER }}
registry-username: ${{ secrets.REGISTRY_USERNAME }}
registry-password: ${{ secrets.REGISTRY_PASSWORD }}
name: fairhub-flask-api-staging
location: "west us"

0 comments on commit 5a2f196

Please sign in to comment.