Skip to content
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

The instructions on using GitHub Pages to publish docs are outdated and will stop working on June 30th #92

Open
felixfontein opened this issue Jun 26, 2024 · 8 comments

Comments

@felixfontein
Copy link
Collaborator

The way setting up GH pages publishing is described on https://github.com/ansible-community/github-docs-build/wiki/Getting-started-with-GitHub-Pages#enabling-pages is outdated and will stop working on June 30th, according to https://www.josephguadagno.net/2024/04/03/migrate-to-github-actions-from-pages-legacy-worker. Despite the mention of Jekyll all over that blog post this also affects publishing raw HTML pages (as used by the shared workflows from this repo).

Fixing this is probably quite easy, you simply need to add a workflow to the main branch that handles pushes to the gh-pages branch and publishes them (look for Static HTML Workflow Template in the blog post). I'll try this out later or tomorrow and will report back here how it went.

Ref: ansible-community/ansible-build-data#416

@felixfontein
Copy link
Collaborator Author

felixfontein commented Jun 26, 2024

UPDATE: See #92 (comment) for how to fix this.

Actually fixing this is very simple:

  1. Go to the repo's settings, the GitHub Pages tab, and change "Build and deployment"'s "Source" from "Deploy from a branch" to "GitHub Actions".
  2. Create a commit similar to ansible-collections/community.crypto@06c976e in the gh-pages branch (adjust the URL in line 26 of the workflow!) and push it.

@samccann
Copy link

So along with the wiki needing updates, we also need to update the shared workflow, right? - https://github.com/ansible-community/github-docs-build/blob/main/.github/workflows/_shared-docs-build-publish-gh-pages.yml

@webknjaz
Copy link
Member

@samccann using shared workflow would be a bit more tricky — all the callers would have to set up the correct privileges as well.

@felixfontein
Copy link
Collaborator Author

felixfontein commented Jun 27, 2024

No change at is needed to the shared workflow. (The Wiki should be updated though.)

@felixfontein
Copy link
Collaborator Author

felixfontein commented Jun 27, 2024

Hmm, something isn't working correctly yet. When creating a PR or updating it, the docs workflow updates the gh-pages branch (as before). But for some reason the push trigger for the gh-pages branch doesn't trigger the workflow in that case.

(Test cases: ansible-collections/community.hrobot#114, felixfontein/ansible-acme#80 - in both cases the gh-pages branch has been pushed to, but the GH Pages update workflow isn't triggered. In the community.hrobot repo I even added the workflow to the main branch as well, in case that makes a difference, but same result...)

(https://github.com/ansible-collections/community.hrobot/blob/gh-pages/.github/workflows/deploy-gh-pages.yml / https://github.com/ansible-collections/community.hrobot/blob/main/.github/workflows/deploy-gh-pages.yml)

@briantist
Copy link
Collaborator

briantist commented Jun 27, 2024

But for some reason the push trigger for the gh-pages branch doesn't trigger the workflow in that case.

I believe this is expected, events that trigger workflows do not trigger them when the thing was initiated by a workflow, to prevent infinite loops. It's tied to the token, you have to use a PAT to cause those events to trigger workflows normally.

This might be something we could instead use the workflow_run trigger for: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflow_run

I haven't looked closely at what's been done so far though, I've been AFK for most of the week, and have very little time available, apologies.

@felixfontein
Copy link
Collaborator Author

I might have figured out a way to do it: #93 That doesn't require to have the workflow in the gh-pages branch (or in main), but only a small modification of the repository's docs PR/push workflows that call the shared workflows.

felixfontein added a commit to felixfontein/community.crypto that referenced this issue Jun 29, 2024
felixfontein added a commit to felixfontein/community.dns that referenced this issue Jun 29, 2024
felixfontein added a commit to felixfontein/community.docker that referenced this issue Jun 29, 2024
felixfontein added a commit to felixfontein/community.internal_test_tools that referenced this issue Jun 29, 2024
felixfontein added a commit to felixfontein/community.routeros that referenced this issue Jun 29, 2024
felixfontein added a commit to felixfontein/community.sops that referenced this issue Jun 29, 2024
felixfontein added a commit to felixfontein/ansible-acme that referenced this issue Jun 29, 2024
felixfontein added a commit to felixfontein/community.library_inventory_filtering that referenced this issue Jun 29, 2024
felixfontein added a commit to ansible-collections/community.sops that referenced this issue Jun 29, 2024
felixfontein added a commit to ansible-collections/community.routeros that referenced this issue Jun 29, 2024
felixfontein added a commit to ansible-collections/community.library_inventory_filtering that referenced this issue Jun 29, 2024
felixfontein added a commit to ansible-collections/community.internal_test_tools that referenced this issue Jun 29, 2024
felixfontein added a commit to ansible-collections/community.crypto that referenced this issue Jun 29, 2024
felixfontein added a commit to ansible-collections/community.hrobot that referenced this issue Jun 29, 2024
felixfontein added a commit to ansible-collections/community.dns that referenced this issue Jun 29, 2024
patchback bot pushed a commit to ansible-collections/community.dns that referenced this issue Jun 29, 2024
felixfontein added a commit to ansible-collections/community.docker that referenced this issue Jun 29, 2024
@felixfontein
Copy link
Collaborator Author

felixfontein commented Jun 29, 2024

Ok, now that #93 is merged, you can (and actually have to, due to an unexpected side-effect: #93 (comment)) update the workflows in your repository as here: ansible-collections/community.sops@03d53d0

EDIT: You still need to do: Go to the repo's settings, the GitHub Pages tab, and change "Build and deployment"'s "Source" from "Deploy from a branch" to "GitHub Actions".

Adding the workflow to the gh-pages branch as described in #92 (comment) is not necessary.

felixfontein added a commit to ansible-collections/community.dns that referenced this issue Jun 29, 2024
AndrewJDawes pushed a commit to codekaizen-github/community.docker that referenced this issue Jun 29, 2024
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

No branches or pull requests

4 participants