From 092cd2231139874ecae25ec95111ab434f00c68c Mon Sep 17 00:00:00 2001 From: Collin Barrett Date: Fri, 14 Jun 2024 12:57:20 -0500 Subject: [PATCH] =?UTF-8?q?feat(web):=20=E2=9C=A8=E2=9A=A1=EF=B8=8F=20cach?= =?UTF-8?q?e=20npm=20deps=20in=20pipeline?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/web.yml | 61 ++++++++++++++++++++++++++++++++------- 1 file changed, 51 insertions(+), 10 deletions(-) diff --git a/.github/workflows/web.yml b/.github/workflows/web.yml index a407ea2e8..696193e85 100644 --- a/.github/workflows/web.yml +++ b/.github/workflows/web.yml @@ -31,15 +31,35 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Build & Deploy + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: lts/* + cache: npm + cache-dependency-path: web/package-lock.json + + - name: Install + run: npm ci + working-directory: ./web + + - name: Build + run: npm run build + working-directory: ./web + + - name: Copy Static Web App Config + run: cp staticwebapp.config.json build/ + working-directory: ./web + + - name: Deploy id: builddeploy uses: Azure/static-web-apps-deploy@v1 with: azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_STAPP_FILTERLISTS_PROD }} repo_token: ${{ secrets.GITHUB_TOKEN }} - action: "upload" - app_location: "./web" - output_location: "build" + action: upload + app_location: ./web/build + output_location: '' + skip_app_build: true build_and_deploy_production: name: Build & Deploy to Production @@ -56,14 +76,35 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Build & Deploy + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: lts/* + cache: npm + cache-dependency-path: web/package-lock.json + + - name: Install + run: npm ci + working-directory: ./web + + - name: Build + run: npm run build + working-directory: ./web + + - name: Copy Static Web App Config + run: cp staticwebapp.config.json build/ + working-directory: ./web + + - name: Deploy + id: builddeploy uses: Azure/static-web-apps-deploy@v1 with: azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_STAPP_FILTERLISTS_PROD }} repo_token: ${{ secrets.GITHUB_TOKEN }} - action: "upload" - app_location: "./web" - output_location: "build" + action: upload + app_location: ./web/build + output_location: '' + skip_app_build: true close_pull_request: name: Close Pull Request @@ -77,5 +118,5 @@ jobs: uses: Azure/static-web-apps-deploy@v1 with: azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_STAPP_FILTERLISTS_PROD }} - action: "close" - app_location: "./web" \ No newline at end of file + action: close + app_location: ./web \ No newline at end of file