diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml index 825e57e2..078da2c3 100644 --- a/.github/workflows/frontend.yml +++ b/.github/workflows/frontend.yml @@ -35,7 +35,26 @@ jobs: run: dotnet build OneShelf.Frontend/OneShelf.Frontend.Web/OneShelf.Frontend.Web.csproj --no-restore --configuration Release - name: Publish 1 run: dotnet publish OneShelf.Frontend/OneShelf.Frontend.Web/OneShelf.Frontend.Web.csproj --no-restore --configuration Release - + + - name: Get current date + id: date + run: echo "::set-output name=date::$(date +'%Y-%m-%d')" + + - name: Replace 1 + uses: richardrigutins/replace-in-files@v2 + with: + files: 'OneShelf.Frontend/OneShelf.Frontend.Web/wwwroot/service-worker.published.js' + search-text: '{#CACHE_VERSION#}' + replacement-text: "${{ github.ref_name }}-${{ steps.date.outputs.date }}" + + - name: Replace 2 + uses: richardrigutins/replace-in-files@v2 + with: + files: 'OneShelf.Frontend/OneShelf.Frontend.Web/wwwroot/index.html' + search-text: '{#CACHE_VERSION#}' + replacement-text: "${{ github.ref_name }}-${{ steps.date.outputs.date }}" + + - run: Compress-Archive -Path OneShelf.Frontend/OneShelf.Frontend.Web/bin/Release/net8.0/publish/* -Destination OneShelf.Frontend.Web.zip - uses: "marvinpinto/action-automatic-releases@latest"