Skip to content

Commit

Permalink
Update cicd.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
MysticFragilist authored Apr 3, 2024
1 parent 684af0e commit 992251f
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/cicd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ on:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
AZURE_RES_GROUP: Hello
AZURE_CONTAINER_APP: backend-hello

jobs:
build:
Expand Down Expand Up @@ -51,10 +53,25 @@ jobs:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Login to Azure
if: startsWith(github.ref, 'refs/tags/v')
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}

- name: Set new image tag for Azure Container App
if: startsWith(github.ref, 'refs/tags/v')
uses: azure/CLI@v1
with:
azcliversion: 2.0.72
inlineScript: |
az containerapp update --name ${{ env.AZURE_CONTAINER_APP }} --resource-group ${{ env.AZURE_RES_GROUP }} --image ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name[1:] }}

0 comments on commit 992251f

Please sign in to comment.