After some thorough testing, finally made prettier on PR work. Since an
html file can't be used as comment on GitHub, changed to simply point to
the action that failed and to the file containing the html diff.
Signed-off-by: George Araújo <george.gcac@gmail.com>
Splitted prettier GitHub action into two:
- `on push`, only runs on direct pushes, if test fails generates an
artifact (that lasts for 3 days) with an html version of the changes
needed to pass prettier test
- `on PR`, only runs on PRs, if test fails comments on the PR with the
HTML content of the diff
I couldn't actually test the `on PR` version since it needs to be on a
PR in the master branch, so this will only be triggered after this PR is
accepted, and for the next PR that fails prettier test.
PS: currently the artifact is a zip file with the html inside. It is not
currently possible to generate it other way, we have to wait for [this
issue](https://github.com/actions/upload-artifact/issues/14) to be
closed.
---------
Signed-off-by: George Araújo <george.gcac@gmail.com>
The GitHub actions were running everytime a new commit was made to the
repo, but that wasn't needed. For example, we don't need to try to
create a new docker image if the libraries didn't change, same to build
the whole site after a change in the README.md.
---------
Signed-off-by: George Araújo <george.gcac@gmail.com>
Added another GitHub action to check for broken local links on version
of the site that will be deployed.
The `broken-links` action check for broken links considering
documentation files (like INSTALLING.md) and also pages like
[_pages/about.md](https://github.com/alshedivat/al-folio/blob/master/_pages/about.md),
but it can't check for broken links when the link will be handled by
jekyll tags (like in
[_pages/blog.md](https://github.com/alshedivat/al-folio/blob/master/_pages/blog.md).
With `broken-links-site` we can check if all the links that will be used
on the final site that refer to local files are correct. Focusing only
on local files since this would end up calling too many checks for
library files, like
`https://unpkg.com/bootstrap-table@1.22.1/dist/bootstrap-table.min.css`.
---------
Signed-off-by: George Araújo <george.gcac@gmail.com>
summary:
- adds prettier formatter configuration
- formats the entire repo using prettier, ignoring minified files
(`*.min.css`) and heavy generated html
- changes extensions of all `.html` files to `.liquid`, which is more
correct and necessary for prettier to work correctly
- replaces "%-" and "-%" with just "%" — manual liquid formatting using
minus signs is superfluous since we are compressing and minifying the
code anyway
- adds CI action for running prettier check on PR and pushes to master