Skip to content

Build and deploy page via CI #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 20, 2023
Merged

Build and deploy page via CI #14

merged 2 commits into from
Feb 20, 2023

Conversation

Consolatis
Copy link
Member

@Consolatis Consolatis commented Feb 19, 2023

This is the rough plan so far, the actual CI build isn't yet implemented. Still need to figure out how custom site pushes work.

Once we actually want to use this we'll likely have to change the repo config to deploy from the main branch and deploy directory but I didn't yet investigate all the details. Doesn't look like we have to change that, but instead have to change something to use actions for deployments.

So what does this do so far?

  • adds IRC notifications for issues / PRs, same as for the main repo
  • deletes all compiled .html files
  • creates a new deploy directory
  • moves the img subfolder in there
  • adds a new build.sh script which
    • clones the latest labwc
    • compiles all files into the new deploy directory
  • adds a .gitignore to ignore
    • labwc/
    • deploy/*.html
  • splits the template file into a _pre and _post file

@Consolatis Consolatis changed the title Ci prepare CI prepare Feb 19, 2023
@Consolatis
Copy link
Member Author

@johanmalm
Copy link
Contributor

Looks good.

Will the website with index.html in deploy/ ?
…and with deploy/*.html in .gitignore?

@Consolatis
Copy link
Member Author

Consolatis commented Feb 20, 2023

I've just tested the whole thing in my fork of the repo and it just worked and deployed the whole site to my personal gh page.
You'll have to change the deploy strategy for this repo to GitHub Actions (no further settings required on that page): Repo Settings -> Pages -> GitHub Actions
I think this is ready to go :)

I completely removed the old build-site script and replaced it with the new one:

  • the filetime check is gone (but didn't actually work for me in the first place because on every change of the branch the HTML files would get a newer timestamp than the compiled man pages from labwc)
  • all files will now be created in deploy, so just running ./build-site like before should provide a complete preview in the new directory
  • the workflow can also be run manually via the Actions tab if the need should arise.

If you prefer I could also split the commit, I just thought a clean git history is not that important for this repo.

@Consolatis Consolatis marked this pull request as ready for review February 20, 2023 07:04
@Consolatis Consolatis changed the title CI prepare Build and deploy page via CI Feb 20, 2023
- push (e.g. accepting a PR)
- manually via Actions tab
- potentially in the future via webhook triggered by labwc
@johanmalm johanmalm merged commit 933266c into labwc:main Feb 20, 2023
@Consolatis Consolatis deleted the ci_prepare branch February 20, 2023 18:57
@Consolatis
Copy link
Member Author

Consolatis commented Feb 20, 2023

Sweet, seems to work :)
https://github.com/labwc/labwc.github.io/actions/runs/4226331235

And https://labwc.github.io doesn't seem broken either + it was indeed rebuilt (can be seen on the menu font still being sans-serif even when in a man page).

So now just merging a PR with modification in src/ should automatically rebuild the website and deploy it.

@johanmalm
Copy link
Contributor

Yes. Amazing. I kept looking for the html files in deploy/ but it seems to work without them.

This is a really nice setup. Thanks for researching+implementing.

@Consolatis
Copy link
Member Author

Consolatis commented Feb 20, 2023

Now all that's left is to add another CI job to the main repo on pushes that checks if any of the new commits include changes to one of the man pages and if yes triggers a webhook in this repository which then automatically triggers the new CI job here.
This end of that call chain should already be set up correctly, I'll look into the sender part in the main repo in the next days.

@johanmalm
Copy link
Contributor

Cool.
…and maybe add a paragraph in the readme to remind us how it works in a few weeks time - and for new devs

@Consolatis
Copy link
Member Author

I could throw a README into .github/workflows/ for both repositories.

@johanmalm
Copy link
Contributor

I could throw a README into .github/workflows/ for both repositories.

That would ideal

@johanmalm
Copy link
Contributor

PS. My IRC bouncer is down so can't connect at the moment.

@Consolatis
Copy link
Member Author

Alright, will cook something up in the next days.

PS. My IRC bouncer is down so can't connect at the moment.

Oh noes. Maybe sr.ht would be an alternative? I think they only offer bouncer accounts for paid members though, or maybe they would be up for supporting labwc with a bouncer account or two.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants