# Collection documentation using GitHub Actions: changes to how GH pages can be published

**URL:** <https://forum.ansible.com/t/collection-documentation-using-github-actions-changes-to-how-gh-pages-can-be-published/6796>\
**Category:** Project Discussions\
**Tags:** news-for-maintainers, github, documentation, collections\
**Created:** [June 26, 2024, 7:34pm UTC](https://forum.ansible.com/t/collection-documentation-using-github-actions-changes-to-how-gh-pages-can-be-published/6796 "2024-06-26T19:34:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![felixfontein](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/felixfontein/32/7530_2.png) [@felixfontein](https://forum.ansible.com/u/felixfontein)\
**Post date:** [June 26, 2024, 7:34pm UTC](https://forum.ansible.com/t/collection-documentation-using-github-actions-changes-to-how-gh-pages-can-be-published/6796/1 "2024-06-26T19:34:44Z")

</div>

GitHub recently [announced](https://www.josephguadagno.net/2024/04/03/migrate-to-github-actions-from-pages-legacy-worker) that the method that is described in [ansible-community/github-docs-build](https://github.com/ansible-community/github-docs-build/) wiki on [Getting started with GitHub Pages · ansible-community/github-docs-build Wiki · GitHub](https://github.com/ansible-community/github-docs-build/wiki/Getting-started-with-GitHub-Pages#enabling-pages) no longer works.

If you are using the workflows (usually you will have `.github/workflows/docs-*.yml` for that in your repository) to publish the docs to GitHub pages, you can switch to the new publishing system as follows:

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. (THIS STEP HAS BEEN UPDATED!) Create a commit similar to [ansible-collections/community.sops@03d53d08942161491df294ad68bf275abacc5363](https://github.com/ansible-collections/community.sops/commit/03d53d08942161491df294ad68bf275abacc5363) in the `main` branch (and backport it to every active `stable-x` branch that contains the `docs-pr.yml` and `docs-push.yml` workflows as well!).

That’s it 🙂

Note that the old way will stop working on **June 30th** , so please don’t forget about this!

---

<div class="post-metadata">

**Author:** ![felixfontein](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/felixfontein/32/7530_2.png) [@felixfontein](https://forum.ansible.com/u/felixfontein)\
**Post date:** [June 27, 2024, 4:25pm UTC](https://forum.ansible.com/t/collection-documentation-using-github-actions-changes-to-how-gh-pages-can-be-published/6796/2 "2024-06-27T16:25:13Z")

</div>

EDIT: The above have been updated (see the third post in this thread) and now works.

Hmm, it looks like this doesn’t fully fix the problem, since when a workflow pushes to the `gh-pages` branch, this will **not** trigger the workflow that reacts to `gh-pages` pushes (so it can publish the pages). The discussion on this will happen in [The instructions on using GitHub Pages to publish docs are outdated and will stop working on June 30th · Issue #92 · ansible-community/github-docs-build · GitHub](https://github.com/ansible-community/github-docs-build/issues/92), I’ll write here again when we find a working solution.

---

<div class="post-metadata">

**Author:** ![felixfontein](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/felixfontein/32/7530_2.png) [@felixfontein](https://forum.ansible.com/u/felixfontein)\
**Post date:** [June 29, 2024, 3:37pm UTC](https://forum.ansible.com/t/collection-documentation-using-github-actions-changes-to-how-gh-pages-can-be-published/6796/3 "2024-06-29T15:37:13Z")

</div>

Ok, there is a working fix now, that requires you to update the `docs-pr.yml` and `docs-push.yml` workflows. Check out [Adjust docs publishing workflow. (#189) · ansible-collections/community.sops@03d53d0 · GitHub](https://github.com/ansible-collections/community.sops/commit/03d53d08942161491df294ad68bf275abacc5363) to see what exactly you have to change!
