Skip to content

Deploy to Azure swearena (swearena.com) #3

Deploy to Azure swearena (swearena.com)

Deploy to Azure swearena (swearena.com) #3

name: Deploy to Azure swearena (swe-arena.com)
on:
workflow_dispatch
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout main branch
uses: actions/checkout@v3
with:
ref: main
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to Azure Container Registry
uses: azure/docker-login@v1
with:
login-server: ${{ secrets.AZURE_REGISTRY_LOGIN_SERVER }}
username: ${{ secrets.AZURE_REGISTRY_USERNAME }}
password: ${{ secrets.AZURE_REGISTRY_PASSWORD }}
- name: Build Docker image
run: docker build -f swe_arena_serve.Dockerfile -t ${{ secrets.AZURE_REGISTRY_LOGIN_SERVER }}/swearenaapp:${{ github.sha }} .
- name: Push Docker image to Azure Registry
run: docker push ${{ secrets.AZURE_REGISTRY_LOGIN_SERVER }}/swearenaapp:${{ github.sha }}
- name: Deploy to Azure App Service
uses: azure/webapps-deploy@v2
with:
app-name: ${{ secrets.AZURE_APP_NAME }}
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
images: '${{ secrets.AZURE_REGISTRY_LOGIN_SERVER }}/swearenaapp:${{ github.sha }}'