Skip to content

Dashboard Deployment #6

Dashboard Deployment

Dashboard Deployment #6

Workflow file for this run

name: Dashboard Deployment
env:
registryName: m3hwlbiw466g4cosureg.azurecr.io
repositoryName: techexcel/csdash
dockerFolderPath: ./src/ContosoSuitesDashboard
tag: ${{github.run_number}}
on:
push:
branches: [ main ]
paths: src/ContosoSuitesDashboard/**
pull_request:
branches: [ main ]
paths: src/ContosoSuitesDashboard/**
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
dockerBuildPush:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Docker Login
# You may pin to the exact commit or the version.
# uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
uses: docker/login-action@v3
with:
# Server address of Docker registry. If not set then will default to Docker Hub
registry: ${{ secrets.ACR_LOGIN_SERVER }}
# Username used to log against the Docker registry
username: ${{ secrets.ACR_USERNAME }}
# Password or personal access token used to log against the Docker registry
password: ${{ secrets.ACR_PASSWORD }}
# Log out from the Docker registry at the end of a job
logout: true
- name: Create Secrets File
run: echo "$STREAMLIT_SECRETS" > ./src/ContosoSuitesDashboard/.streamlit/secrets.toml
shell: bash
env:
STREAMLIT_SECRETS: ${{ secrets.STREAMLIT_SECRETS }}
- name: Docker Build
run: docker build -t $registryName/$repositoryName:$tag --build-arg build_version=$tag $dockerFolderPath
- name: Docker Push
run: docker push $registryName/$repositoryName:$tag
deploy-to-prod:
runs-on: ubuntu-latest
needs: dockerBuildPush
environment:
name: prod
url: https://m3hwlbiw466g4-dash.azurewebsites.net
steps:
- uses: actions/checkout@v4
- name: 'Login via Azure CLI'
uses: azure/[email protected]
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- uses: azure/webapps-deploy@v2
with:
app-name: m3hwlbiw466g4-dash
images: m3hwlbiw466g4cosureg.azurecr.io/techexcel/csdash:${{github.run_number}}