Skip to content

Commit

Permalink
Add caching in build action
Browse files Browse the repository at this point in the history
  • Loading branch information
Lev Khobotov committed Mar 20, 2024
1 parent 1ea5c15 commit b9a333f
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,22 @@ 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: |
dotnet nuget update source ${{ env.NUGET_SOURCE_NAME }} --store-password-in-clear-text --username ${{ env.NUGET_USERNAME }} --password ${{ secrets.PACKAGES_TOKEN }}
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 }}
Expand All @@ -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 }}'

0 comments on commit b9a333f

Please sign in to comment.