notes icon indicating copy to clipboard operation
notes copied to clipboard

Add GitHub Actions Workflow for Continuous Deployment of HTML Documents

Open ATQlove opened this issue 1 year ago • 1 comments

What

I have added a new GitHub Actions workflow file named cd-convert-debian-bookworm.yml. This workflow automates the continuous deployment (CD) process, including converting documents using TeXmacs and deploying the results to the gh-pages branch.

Why

  1. Through this CD implementation, HTML documents in the docs folder can be automatically deployed to the webpage via GitHub Pages.
  2. TeXmacs requires a graphical environment to run. Since GitHub Actions runs in a headless environment, I included xvfb to simulate a display server, allowing TeXmacs to operate without a physical display.
  3. The workflow is also triggered on pull requests to the main branch to demonstrate to reviewers that the file runs correctly. This trigger condition will be removed once the pull request meets the merge requirements.

ATQlove avatar Aug 02 '24 07:08 ATQlove

@da-liii Please help me to see if there is something wrong with this pr, thanks!

ATQlove avatar Aug 02 '24 07:08 ATQlove

TeXmacs has now an -headless option. Can this PR be improved and completed using this?

mgubi avatar Nov 15 '24 20:11 mgubi

TeXmacs has now an -headless option. Can this PR be improved and completed using this?

Hello, thank you for your reply! Could you please provide more information about "-headless"? Or at least share some details about this update so that I can improve the PR more quickly.

ATQlove avatar Nov 15 '24 20:11 ATQlove

see https://github.com/texmacs/texmacs/blob/v2.1.4/src/Texmacs/Texmacs/texmacs.cpp#L211

da-liii avatar Nov 16 '24 12:11 da-liii

see https://github.com/texmacs/texmacs/blob/v2.1.4/src/Texmacs/Texmacs/texmacs.cpp#L211

Thanks for the help! I have switched to using the -headless option instead of xvfb for continuous deployment.

ATQlove avatar Nov 16 '24 18:11 ATQlove

The check failed because the gh-pages branch does not exist, and I don't have permission to create such a branch. Could someone help me create a gh-pages branch so that the code can be tested to verify if it runs correctly?

ATQlove avatar Nov 18 '24 08:11 ATQlove

Thanks. I've added the branch.

mgubi avatar Nov 18 '24 09:11 mgubi

I do not like much that we take an action from an external source which is not github. Why we do not follow the suggested workflow here: https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site#creating-a-custom-github-actions-workflow-to-publish-your-site where the action https://github.com/actions/upload-pages-artifact is suggested to upload artifacts? Seems relatively straigforward. Is there a reason to do otherwise?

mgubi avatar Nov 18 '24 11:11 mgubi

I do not like much that we take an action from an external source which is not github.

For security concerns, I agree with you.

da-liii avatar Nov 18 '24 11:11 da-liii

If we want to use an external action then we should be sure that we download the version we checked. Can we identify the action via its SHA1 ? That would be ok enough for me.

There are still problems with this PR, it seems I cannot figure out how to give it enough permission to push the material to the repository. It is maybe due to the fact that it is a PR?

mgubi avatar Nov 18 '24 12:11 mgubi

Ok, it seems that it is working after it has been merged and run from the repo (instead of from the PR). This sounds reasonable. Still it is not good as copying all the documents in docs/ in the root directory of the branch and forgetting to carry over the index.html file, results in the branch being unusable for GitHub pages.

mgubi avatar Nov 18 '24 14:11 mgubi

We could use this explicit workflow: https://joht.github.io/johtizen/build/2022/01/20/github-actions-push-into-repository.html#example-1 instead of the action from the external repo.

mgubi avatar Nov 18 '24 14:11 mgubi

We could use this explicit workflow: https://joht.github.io/johtizen/build/2022/01/20/github-actions-push-into-repository.html#example-1 instead of the action from the external repo.

Thanks for help!I created a new PR to refine it. https://github.com/texmacs/notes/pull/59

ATQlove avatar Nov 18 '24 20:11 ATQlove