From b9a333fea8aab91d1bb77b33ebb5b2f4b713bb5b Mon Sep 17 00:00:00 2001 From: Lev Khobotov Date: Wed, 20 Mar 2024 21:53:39 +0300 Subject: [PATCH] Add caching in build action --- .github/workflows/main.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1fe8a01..662bb01 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -50,6 +50,14 @@ jobs: with: dotnet-version: ${{ env.DOTNET_VERSION }} + - name: Set up dependency caching for faster builds + uses: actions/cache@v3 + with: + path: ~/.nuget/packages + key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} + restore-keys: | + ${{ runner.os }}-nuget- + # Restore packages - name: Restore packages run: | @@ -57,7 +65,7 @@ jobs: dotnet restore # Run dotnet build and publish - - name: dotnet build and publish + - name: Build and publish run: | dotnet build --configuration Release dotnet publish -c Release -o ${{ env.AZURE_WEBAPP_PROJECT_PATH }} @@ -68,5 +76,5 @@ jobs: uses: azure/webapps-deploy@v2 with: app-name: ${{ env.AZURE_WEBAPP_NAME }} - publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} + publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} package: '${{ env.AZURE_WEBAPP_PACKAGE_PATH }}/${{ env.AZURE_WEBAPP_PROJECT_PATH }}'