Skip to content

Build container and push to ACR #3

Build container and push to ACR

Build container and push to ACR #3

Workflow file for this run

name: Build container and push to ACR
on:
workflow_dispatch:
permissions:
contents: read
env:
IMAGE: 'futarin-api'
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: 'Checkout GitHub Action'
uses: actions/checkout@v4
- name: 'Set up Docker Buildx'
uses: docker/setup-buildx-action@v3
- name: 'Docker Login'
uses: docker/login-action@v3
with:
registry: ${{ vars.LOGIN_SERVER }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: 'Compose Customized Docker Image'
run: |
docker buildx build --platform linux/amd64,linux/arm64 \
--build-args ENV=production \
-f ./_docker/api/Dockerfile \
-t ${{ vars.LOGIN_SERVER }}/${{ env.IMAGE }}:${{ github.sha }} \
--push .
- name: 'Deploy to Azure Web App'
uses: azure/webapps-deploy@v2
with:
app-name: 'futarin-api'
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
images: '${{ vars.LOGIN_SERVER }}/${{ env.IMAGE }}:${{ github.sha }}'