Skip to content

Docker Github Action Dashboard #11

Docker Github Action Dashboard

Docker Github Action Dashboard #11

name: Dashboard - Build and deploy to production
on:
push:
branches:
- main
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout GitHub Actions
uses: actions/checkout@main
- name: Login via Azure CLI
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Login to Azure Container Registry
uses: azure/docker-login@v1
with:
login-server: fastapicd2024.azurecr.io
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Build and push container image to registry
run: |
docker build . -t fastapicd2024.azurecr.io/dashboard-cd:${{ github.sha }} --file 3_Streamlit_dashboard/Dockerfile
docker push fastapicd2024.azurecr.io/dashboard-cd:${{ github.sha }}
- name: Deploy to App Service
uses: azure/webapps-deploy@v2
with:
app-name: 'credit-score-dashboard'
images: 'fastapicd2024.azurecr.io/dashboard-cd:${{ github.sha }}'
#slot-name: 'staging'
- name: Azure logout
run: |
az logout