Skip to content

Conversation

@severinbratus
Copy link
Contributor

@severinbratus severinbratus commented May 6, 2024

Idea: Use actions/cache/restore action if the build step fails, with a bogus key (none) and partial restore key html-build-<branchname>, which would match the most recent build on the branch. For technical details see https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#matching-a-cache-key

For an example see: https://github.com/TeachBooks/testable-template/actions/runs/8970098300 Build failed, previous version still live at https://teachbooks.github.io/testable-template/feat-20/intro.html

Resolves #25, #24

Copy link
Member

@Tom-van-Woudenberg Tom-van-Woudenberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This requires for sure a notification in the summary as well (linked to #24 ), otherwise users might be confused that changes are not visible in the build book.
What if the caches isn't available any more (they expire right?)? I first thought that you might rebuild the previous commit which was succesful (if that one is available). However, book builds might also fail because a package is updated causes inconsistensies. The requirements.txt might still be the same, but the resulting environment might be different. In that case rebuilding with the previous commit won't work either...
So I guess when the cache isn't available any more, make it very clear in the summary that this branch is not published (also related to #24 )

@severinbratus
Copy link
Contributor Author

This requires for sure a notification in the summary as well (linked to #24 ), otherwise users might be confused that changes are not visible in the build book.
What if the caches isn't available any more (they expire right?)?
In this case nothing is deployed (we call this a cache miss, meaning no restore).

I first thought that you might rebuild the previous commit which was succesful (if that one is available). However, book builds might also fail because a package is updated causes inconsistensies. The requirements.txt might still be the same, but the resulting environment might be different. In that case rebuilding with the previous commit won't work either... So I guess when the cache isn't available any more, make it very clear in the summary that this branch is not published (also related to #24 )

OK! the way I see this: we have a column with either Deployed, Build failed (1), Build failed (2) (and a legend with 1) book published, last published version reused, 2) book not published). If you see a better format, let me know.

@Tom-van-Woudenberg
Copy link
Member

Tom-van-Woudenberg commented May 8, 2024

OK! the way I see this: we have a column with either Deployed, Build failed (1), Build failed (2) (and a legend with 1) book published, last published version reused, 2) book not published). If you see a better format, let me know.

@severinbratus, sounds good!
I think we should add it as text to the root branch line as well, and as an extra column to the aliases table too

@severinbratus
Copy link
Contributor Author

Many commits later, here is what an example summary it looks like: https://github.com/TeachBooks/testable-template/actions/runs/9112678442

Copy link
Member

@Tom-van-Woudenberg Tom-van-Woudenberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since only one alias works, I adapted the manual. Could you remove the default draft:main alias as it will probably not be used a lot?
After that you can merge this directly

@severinbratus severinbratus merged commit c4d5d96 into main May 22, 2024
@Tom-van-Woudenberg Tom-van-Woudenberg deleted the feat/20/no-update-on-failure branch May 22, 2024 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

Do not re-publish to Pages on failure

3 participants