Deploy to Azure swearena (swearena.com) #3
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
| 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 }}' |