Skip to content

Trigger auto deployment #22

Trigger auto deployment

Trigger auto deployment #22

Workflow file for this run

name: Trigger auto deployment
on:
push:
branches: [main]
# Allow manual trigger
workflow_dispatch:
permissions:
id-token: write
contents: read
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout to the branch
uses: actions/checkout@v2
- name: Docker Login
uses: docker/login-action@v3
with:
registry: ${{ secrets.ACR_URL }}
username: ${{ secrets.ACR_USERNAME }}
password: ${{ secrets.ACR_PASSWORD }}
- name: Azure Login
uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: Build and Push to ACR
uses: docker/build-push-action@v2
with:
push: true
tags: ${{ secrets.ACR_URL }}/krokelo:${{ github.sha }}
file: Dockerfile
build-args: |
DATABASE_URL=${{ secrets.DATABASE_URL }}
- name: Redeploy Azure Container App
run: |
az containerapp revision copy \
--name krokelo \
--resource-group sbu-public-krokelo-nww-nea-rg \
--cpu 1 \
--memory 2.0 \
--image ${{ secrets.ACR_URL }}/krokelo:${{ github.sha }}