Skip to content

Conversation

@suve
Copy link
Collaborator

@suve suve commented Nov 16, 2022

Since our original discussion in #28, GitHub has added support (currently in beta) for deploying stuff to GitHub Pages from GitHub Actions. This PR adds a workflow that builds documentation using PasDoc and deploys it to GHPages.

One thing to consider: this introduces a new workflow, which is completely independent from the existing build/test workflow. As such, the docs will get build even if the build/test workflow fails. While it's not exactly straight-forward, it is possible to create inter-workflow dependencies in GHActions. The question is, then: do we want the docs workflow to require the build/test workflow to succeed in order to actually launch?

suve added 2 commits November 16, 2022 15:59
Ubuntu 22.04 contains a newer version of PasDoc - v0.16.0,
compared to v0.15.0 found on Ubuntu 20.04.
@Free-Pascal-meets-SDL-Website
Copy link
Collaborator

Free-Pascal-meets-SDL-Website commented Nov 19, 2022

Due to lack of time to review, I will come back to this soon. But I'm happy to see this going forward.

@Free-Pascal-meets-SDL-Website
Copy link
Collaborator

To be honest, I have zero experience with GH pages.

The script looks good, though I wonder if we need to set up a "project site" prior to deploying the compiled docs? How does GH pages know that the compiled docs are in gh-pages folder? Do we need to set the page up first?

https://pages.github.com/ (click on "Project site" and "Start from scratch")

@suve
Copy link
Collaborator Author

suve commented Dec 16, 2022

The script looks good, though I wonder if we need to set up a "project site" prior to deploying the compiled docs? (https://pages.github.com/ -> click on "Project site" and "Start from scratch")

Reading through the page, it seems to describe the "deploy from a branch" workflow, not the "deploy from GitHub Actions" one. Which makes sense, since the latter is still marked as "beta".

How does GH pages know that the compiled docs are in gh-pages folder?

I assume the Pages-related actions take care of that. I mostly just copied from GitHub's example workflow.

Do we need to set the page up first?

As far as I can tell, all we need to do is go to the repository's settings, and in the Actions tab, choose "GitHub Actions" as the deployment source. (Already done this.)

I played with this shortly in my fork and the deploy went ok. Reverting the Pages site to an older version, or taking it down altogether is also pretty straightforward - so should we, at some point in the future, decide that the "build and maintain docs" idea was a mistake, it's easily fixable.

@Free-Pascal-meets-SDL-Website
Copy link
Collaborator

Free-Pascal-meets-SDL-Website commented Dec 17, 2022

I see, so let's see what happens! Merged!

EDIT: Congratualtions! It works like a charm!

@Free-Pascal-meets-SDL-Website Free-Pascal-meets-SDL-Website merged commit 29ba7ad into PascalGameDevelopment:master Dec 17, 2022
@suve
Copy link
Collaborator Author

suve commented Dec 18, 2022

The CI run completed successfully, the built docs are now available at pascalgamedevelopment.github.io/SDL2-for-Pascal/.

@Free-Pascal-meets-SDL-Website
Copy link
Collaborator

Congratulations again. The link should be added to the README.md.

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