Update checkout version #2
This file contains 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: Build and deploy | |
on: | |
push: | |
branches: | |
- nginx-gateway | |
- main | |
- ci | |
permissions: | |
id-token: write | |
env: | |
AZURE_CORE_OUTPUT: none | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Log in to Azure | |
uses: Azure/login@v1 | |
with: | |
client-id: ${{ secrets.CLIENT_ID }} | |
tenant-id: ${{ secrets.TENANT_ID }} | |
allow-no-subscriptions: true | |
- name: Docker login to ACR | |
run: az acr login --name ${{ secrets.REGISTRY_NAME }} | |
- name: Build and push image | |
run: | | |
docker build -t ${{ secrets.REGISTRY_LOGIN_SERVER }}/kiltiskamera/auth:${{ github.sha }} ../app/backend | |
docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/kiltiskamera/auth:${{ github.sha }} | |
- name: Azure logout | |
run: | | |
az logout | |
deploy: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Log in to Azure | |
uses: Azure/login@v1 | |
with: | |
client-id: ${{ secrets.CLIENT_ID }} | |
tenant-id: ${{ secrets.TENANT_ID }} | |
allow-no-subscriptions: true | |
- name: Deploy from ACR | |
uses: azure/webapps-deploy@v2 | |
with: | |
app-name: 'kiltiskamera' | |
images: | | |
${{ secrets.REGISTRY_LOGIN_SERVER }}/kiltiskamera/auth:${{ github.sha }} | |
- name: Azure logout | |
run: | | |
az logout |