This repository has been archived by the owner on Aug 28, 2024. It is now read-only.
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: If push to the main, deploy it | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
paths: | |
- "canbus-web/**" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
ACR_NAME: ${{ secrets.ACR_NAME }} #woowasiblings | |
APP_NAME: canbus-web | |
APP_ENV: canbus-web-env | |
RG_NAME: ${{ secrets.RG_NAME }} #rg-2024-Woowa-Siblings | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v2 | |
- name: Log in to Azure | |
uses: azure/login@v1 | |
with: | |
creds: ${{ secrets.AZURE_CREDENTIALS }} | |
- name: Build and deploy Container App | |
uses: azure/container-apps-deploy-action@v0 | |
with: | |
appSourcePath: ${{ github.workspace }}/${{ env.APP_NAME }} | |
acrName: ${{ env.ACR_NAME }} | |
acrUsername: ${{ secrets.ACR_USERNAME }} | |
acrPassword: ${{ secrets.ACR_PASSWORD }} | |
containerAppName: ${{ env.APP_NAME }} | |
containerAppEnvironment: ${{ env.APP_ENV }} | |
resourceGroup: ${{ env.RG_NAME }} | |
imageToBuild: ${{ env.ACR_NAME }}.azurecr.io/${{ env.APP_NAME }}:${{ github.sha }} | |
dockerfilePath: Dockerfile | |
- name: Azure Container Apps Ingress Setting | |
run: az containerapp ingress update --name ${{ env.APP_NAME }} --resource-group ${{ env.RG_NAME }} --target-port 3000 --allow-insecure |