From 8effa7bf757209ab63742846f28923ba51c01be9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=A2=85=EC=9C=A4?= <103932812+rlawhddbs@users.noreply.github.com> Date: Mon, 26 Aug 2024 17:39:47 +0900 Subject: [PATCH] Create web-deploy.yml --- .github/workflows/web-deploy.yml | 44 ++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/web-deploy.yml diff --git a/.github/workflows/web-deploy.yml b/.github/workflows/web-deploy.yml new file mode 100644 index 0000000..bc0fef9 --- /dev/null +++ b/.github/workflows/web-deploy.yml @@ -0,0 +1,44 @@ +name: If push to the main, deploy it + +on: + push: + branches: + - main + # paths: + # - "canbus-web/**" + +jobs: + build: + runs-on: ubuntu-latest + + env: + TEAM_NAME: woowasiblings + APP_NAME: canbus-web + APP_ENV: canbus-web-env + 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 }}/$APP_NAME + acrName: $TEAM_NAME + acrUsername: ${{ secrets.ACR_USERNAME }} + acrPassword: ${{ secrets.ACR_PASSWORD }} + containerAppName: $APP_NAME + containerAppEnvironment: $APP_ENV + resourceGroup: $RG_NAME + imageToBuild: $TEAM_NAME.azurecr.io/$APP_NAME:${{ github.sha }} + dockerfilePath: Dockerfile + + - name: Azure Container Apps Ingress Setting + run: az containerapp ingress update --name $APP_NAME --resource-group $RG_NAME --target-port 3000 --allow-insecure