From 56d58df46da02603aee5ae674604bda8ef0c58d6 Mon Sep 17 00:00:00 2001 From: AndPat Date: Thu, 2 Jan 2025 22:00:54 +0100 Subject: [PATCH] minor fix --- ...static-web-apps-mango-flower-0edf37903.yml | 47 +++++++++++-------- 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/.github/workflows/azure-static-web-apps-mango-flower-0edf37903.yml b/.github/workflows/azure-static-web-apps-mango-flower-0edf37903.yml index 1da6ec8..2fbf624 100644 --- a/.github/workflows/azure-static-web-apps-mango-flower-0edf37903.yml +++ b/.github/workflows/azure-static-web-apps-mango-flower-0edf37903.yml @@ -1,36 +1,43 @@ -name: Deploy to Azure Static Web Apps +name: Azure Static Web Apps CI/CD on: push: branches: - main pull_request: - types: [opened, reopened, synchronize] + types: [opened, synchronize, reopened, closed] + branches: + - main jobs: build_and_deploy_job: + if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed') runs-on: ubuntu-latest name: Build and Deploy Job steps: - - name: Checkout repository content - uses: actions/checkout@v3 # Aggiornato a v3 - - - name: Set up Node.js - uses: actions/setup-node@v4 + - uses: actions/checkout@v3 with: - node-version: 20 - - - name: Install dependencies - run: npm install - - - name: Build the application - run: npm run build - - - name: Deploy to Azure Static Web Apps + submodules: true + lfs: false + - name: Build And Deploy + id: builddeploy uses: Azure/static-web-apps-deploy@v1 with: - azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_MANGO_FLOWER_0EDF37903 }} + azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_GENTLE_FLOWER_06B90A80F }} + repo_token: ${{ secrets.GITHUB_TOKEN }} action: "upload" - app_location: "/" # Percorso relativo senza slash iniziale - output_location: "/dist" # Percorso relativo senza slash iniziale - \ No newline at end of file + app_location: "/" + api_location: "api" + output_location: "/dist" + + close_pull_request_job: + if: github.event_name == 'pull_request' && github.event.action == 'closed' + runs-on: ubuntu-latest + name: Close Pull Request Job + steps: + - name: Close Pull Request + id: closepullrequest + uses: Azure/static-web-apps-deploy@v1 + with: + azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_GENTLE_FLOWER_06B90A80F }} + action: "close" \ No newline at end of file