Skip to content

Update main_socalmeshbot.yml #8

Update main_socalmeshbot.yml

Update main_socalmeshbot.yml #8

name: Build and deploy container app to Azure Web App - socalmeshbot
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build:
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout
- name: Set up Docker Buildx
uses: docker/setup-buildx-action
- name: Log in to registry
uses: docker/login-action@v2
with:
registry: dragones.azurecr.io
username: ${{ secrets.AzureAppService_ContainerUsername_1ed55587fd474a6685d49af448067bad }}
password: ${{ secrets.AzureAppService_ContainerPassword_4fc6e7e4f599453a81d4f70c8802b08d }}
- name: Build and push container image to registry
uses: docker/build-push-action
with:
push: true
tags: |
dragones.azurecr.io/socalmeshbot:${{ github.sha }}
file: ./Dockerfile # Make sure the path is correct
deploy:
runs-on: ubuntu-latest
needs: build
environment:
name: 'production'
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
steps:
- name: Deploy to Azure Web App
id: deploy-to-webapp
uses: azure/webapps-deploy
with:
app-name: 'socalmeshbot'
slot-name: 'production' # Ensure the slot exists in Azure Web App
publish-profile: ${{ secrets.AzureAppService_PublishProfile_1027a7ef2c324fb1a4275ee4a67ff831 }}
images: |
dragones.azurecr.io/socalmeshbot:${{ github.sha }}