fix: failing gha #7
This file contains hidden or 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
# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy | |
# More GitHub Actions for Azure: https://github.com/Azure/actions | |
name: mm-mcp-prod | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build-docker-image: | |
runs-on: ubuntu-latest | |
environment: production | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@master | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: 'Docker Login' | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ secrets.ACR_SERVER }} | |
username: ${{ secrets.ACR_USERNAME }} | |
password: ${{ secrets.ACR_PASSWORD }} | |
- name: Build and push | |
uses: docker/build-push-action@v3 | |
with: | |
context: ${{ github.workspace }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
file: ${{ github.workspace }}/Dockerfile.server | |
push: true | |
tags: | | |
${{ secrets.ACR_SERVER }}/mm-mcp-prod:${{ github.sha }} | |
${{ secrets.ACR_SERVER }}/mm-mcp-prod:latest | |
platforms: linux/amd64 | |
deploy-docker-image: | |
runs-on: ubuntu-latest | |
needs: build-docker-image | |
environment: production | |
timeout-minutes: 10 | |
steps: | |
- name: Azure Login | |
uses: azure/login@v1 | |
with: | |
creds: ${{ secrets.AZURE_MCP_PROD }} | |
- name: Azure CLI script to create Container App | |
uses: azure/CLI@v1 | |
with: | |
inlineScript: | | |
RESOURCE_GROUP="rg-mm-apps-prod-sup" | |
LOCATION="westus" | |
CONTAINERAPPS_ENVIRONMENT="cae-mm-supplementry-consumption" | |
az extension add --name containerapp --upgrade | |
az containerapp update -n mm-mcp-prod -g $RESOURCE_GROUP \ | |
--image ${{ secrets.ACR_SERVER }}/mm-mcp-prod:${{ github.sha }} |