getzola / themes

Creates the templates section to be used in Zola doc site
MIT License
60 stars 58 forks source link

[feature] automatize site generation after merge #19

Closed Hugo-Trentesaux closed 4 years ago

Hugo-Trentesaux commented 5 years ago

If someone has experience with GitHub automation, it would be nice to generate automatically the theme site after a merge occurs in master.

Keats commented 4 years ago

That would be very nice.

zbrox commented 4 years ago

This shouldn't be hard to do, I think I can quickly put something together when I have time maybe over the weekend. Probably the only question I think I have is when the site is generated, should it just be saved as a built artifact from the action or should be uploaded somewhere?

Keats commented 4 years ago

The output needs to be committed in https://github.com/getzola/zola since that's where the documentation is. The first step would be to have some CI that highlights which themes are invalid since I keep missing things when I check manually.

zbrox commented 4 years ago

If any of the zola checks for themes fail with an error we fail the whole build, right? The other option I guess is to exclude that theme from the build, but I don't know if the current generator script supports it.

Keats commented 4 years ago

Right now the script just ignores invalid themes and reports them. No reason to block a deploy because one theme is missing something.

zbrox commented 4 years ago

I was mostly referring to the validity check you mentioned in the previous comment. I understood it as running zola check on each theme, before running the generator Python script. And when I ran zola check on each individual theme, it fails for at least one. Should we just ignore these failures and skip those themes?

Keats commented 4 years ago

Ah no sorry, I didn't mean zola check, I meant the generator Python script. This repo is not aware of Zola, it only checks for files and keys in a couple of TOML files. No need for zola check here, just that the script can generate the theme page since that would mean it's probably fine.

The CI would be mainly checking that we are not adding themes that are invalid, because I didn't run the script manually and missed something like https://github.com/carpetscheme/lightspeed/pull/1

zbrox commented 4 years ago

Ah, gotcha :) I made a couple of fixes in the script btw because of lightspeed as well. Should I commit those beforehand?

Hugo-Trentesaux commented 4 years ago

On the 24 themes present in the repo, only 15 appear on the theme page. Is there a problem somewhere?

zbrox commented 4 years ago

I think the latest generated themes site pull request is not merged yet.

Keats commented 4 years ago

I've merged it now

Hugo-Trentesaux commented 4 years ago

Now it's 22/24 :D

zbrox commented 4 years ago

Now it's 22/24 :D

There are 2 themes which have errors so they get excluded by the generation script.

zbrox commented 4 years ago

In the output of the latest run of the action, in the "Run the generator script" step, you can see the themes with errors.

It is zerm because it's missing a screenshot and lightspeed is missing the name property in its metadata.

zbrox commented 4 years ago

@Keats I guess this can be closed as resolved?

ejmg commented 4 years ago

@zbrox where/how do I not generate a proper screenshot for zerm? I have some in the repository already and there is a deployed sample site at https://zerm.ejmg.now.sh/, so it's not like i can't just make another one as needed.

ejmg commented 4 years ago

alright, i've updated master to have a plain screenshot.png. hope that fixes it? @Keats

zbrox commented 4 years ago

@ejmg the zerm submodule is still pointing to the older commit, so i'll push a pull request updating it to the current master in a sec

zbrox commented 4 years ago

@ejmg Zerm is parsed and included in the generated theme site properly now. https://github.com/getzola/themes/runs/966061273?check_suite_focus=true

Next time @Keats merges a pull request from the themes repo it will show up on getzola.org.

[Edit] Sorry for the notifications spam, just noticed that it's merged already :) and Zerm is showing up on getzola.org

ejmg commented 4 years ago

@zbrox you are totally fine, sorry on my part for randomly popping up and @'ing about my theme :sweat_smile:

I randomly remembered that my theme didn't get generated on zola and revisited to see if any developments occurred, rest is now history. Thanks for helping to get it working :slightly_smiling_face:

Hugo-Trentesaux commented 1 year ago

62/65 themes available on the page seems the action ran successfully Zola site still has to be updated.