AsciiDoctor PDF/HTML Converter Action
A GitHub Action that recursively converts every adoc
file to pdf
and html
, naming the files using the same name of the adoc
file then pushing all generated pdf/html files to the main
branch. In addition, it can be manually executed on the other branches.
This Action is a customized version of the AsciiDoctor GitHub Pages Action.
WARNING - Keep in mind that every time the action is executed, the existing pdf/html files are overwritten. If you manually modify them, outside of the CI workflow, the content will be lost.
1. Configuration
You have to just add the action to your yml workflow file and that is it. You can optionally customize the build by giving extra parameters to the action, which will be handed to the asciidoctor tool.
You can check a complete workflow file here. If you don’t want to use the GitHub Action interface and just copy that file to the same place inside your repository, it may work out of the box.
2. How the action works
The action is very simple. It’s fired everytime commits are pushed to a branch or pull request (PR). Everything happens inside a container created on GitHub servers to execute the action. Then, the following steps are performed inside the container:
-
The pushed branch or PR is fetched in order to get the updated files in your repository.
-
Pre-build command (optionally provided in the
pre_build
parameter of your workflow) is executed, to perform any task you want before the AsciiDoc files are built. -
Then, every AsciiDoc file is built to pdf/html and added to the related branch.