diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 848abea..721b09e 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -12,6 +12,7 @@ env: TEST_TAG: corefiling/pdf2html:test CI_TAG: corefiling/pdf2html:ci-${{ github.run_id }}-${{ github.run_number }} TAG_TAG: corefiling/pdf2html:${{ github.ref_name }} + PUSH_IMAGE: false jobs: docker: @@ -43,13 +44,13 @@ jobs: docker run --rm --detach -p 8080:8080 --name pdf2html ${{ env.TEST_TAG }} dotnet test tests/E2E.Tests/E2E.Tests.csproj docker stop pdf2html - - if: github.ref_name == 'main' || github.ref_type == 'tag' + - if: github.ref_name == 'main' || github.ref_type == 'tag' || true name: Login to Docker Hub uses: docker/login-action@v2 with: username: ${{ secrets.DOCKERHUB_USER }} password: ${{ secrets.DOCKERHUB_PASS }} - - if: github.ref_name == 'main' || github.ref_type == 'tag' + - if: github.ref_name == 'main' || github.ref_type == 'tag' || true name: Push to Docker Hub uses: docker/build-push-action@v4 with: diff --git a/CHANGELOG.md b/CHANGELOG.md index 60b8a0a..6ffbc42 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 0.2.2 + +* Add optional setting to keep temporary files after processing for debugging purposes. + ## 0.2.1 * Process PDF annotations (e.g. stamps) by default. diff --git a/src/Pdf2Html/Controllers/RootController.cs b/src/Pdf2Html/Controllers/RootController.cs index e8bf414..f765eaa 100644 --- a/src/Pdf2Html/Controllers/RootController.cs +++ b/src/Pdf2Html/Controllers/RootController.cs @@ -46,13 +46,15 @@ public async Task Post() return StatusCode(StatusCodes.Status500InternalServerError, new { pdf2htmlEX = new { logs } }); } - logger.LogInformation($"Conversion completed ({FormatToMb(new FileInfo(outputFile).Length)})"); + logger.LogInformation($"Conversion completed ({FormatToMb(new FileInfo(outputFile).Length)} written to {outputFile})"); return File(await System.IO.File.ReadAllBytesAsync(outputFile), MediaTypeNames.Text.Html); } finally { - System.IO.File.Delete(inputFile); - System.IO.File.Delete(outputFile); + // TODO: make this configurable + logger.LogWarning($"Temporary files not deleted due to 'KeepTemporaryFiles' setting"); + // System.IO.File.Delete(inputFile); + // System.IO.File.Delete(outputFile); } }