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

Build Hugo site with GitHub Actions and deploy to GitHub Pages #1245

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

umarcor
Copy link
Contributor

@umarcor umarcor commented Oct 4, 2020

In this PR, a GitHub Actions workflow is added for building a web site with Hugo and deploying it to GitHub Pages (branch gh-pages).

  • The content of the README is split to multiple markdown sources.
  • Markdown sources from the root and from subdir doc are moved to site/content .
    • Documentation sources regarding completions are placed in site/content/completions.
    • Documentation sources regarding documentation generation are placed in site/content/docgen.
  • Hugo configuration files are added to site. @bep's docuapi theme is used.
  • In a GitHub Actions workflow, Hugo is installed, the theme is installed, the site is built, and the site is uploaded as an artifact as well as pushed to branch gh-pages.
  • The logo from the README is used in the site (with a different font color).
  • Any contributor that forks the repo and pushes some change, will have the site automatically built and uploaded to username.github.io/cobra.

See:

Ref #985 #1243 #1244

@spf13
Copy link
Owner

spf13 commented Jan 13, 2021

I've opened cobra.dev source to a few contributors. https://github.com/spf13/cobra.dev .
I'd love to support however I can.

@umarcor
Copy link
Contributor Author

umarcor commented Jan 15, 2021

@spf13, thanks a lot! I will repurpose this PR and probably split it between here and spf13/cobra.dev.

Just something I'm unsure about: where is cobra.dev deployed from? spf13/cobra.dev contains the sources of a Hugo site. However, I did not see any branch with the artifacts and as far as I am aware, GitHub can only build Jekyll sites from sources. Hence, I assume that the site is not hosted on GitHub Pages. Do you have some private pipeline/CI to take care of that?

@spf13
Copy link
Owner

spf13 commented Jan 15, 2021 via email

@umarcor
Copy link
Contributor Author

umarcor commented Jan 15, 2021

@spf13, nice and thanks.

For now, it's enough to know that we can handle it with an Action in a GitHub Actions workflow. I will probably propose PRs to be autodeployed to gh-pages of the contributor's fork. That will allow any contributor to push changes and see the results automatically deployed to their username.github.io/cobra or username.github.io/cobra.dev site.

We'll discuss later whether the "official" deployment needs to be done here, in spf13/cobra.dev or somewhere else; that's a minor technical thing.

@github-actions
Copy link

This PR is being marked as stale due to a long period of inactivity

@spf13
Copy link
Owner

spf13 commented Nov 2, 2021

@umarcor what's the status on this. I think your new site is far superior to the existing one. I did a small amount of management to bring it up to date so it builds again, but still prefer yours.

Let me know how I can help with this.

@umarcor
Copy link
Contributor Author

umarcor commented Nov 2, 2021

@spf13, see #1428. That's the first subset of this PR: moving all markdown sources related to the documentation into a single directory.

However, co-maintainers have been struggling to merge PRs in the last months, so I kept this docs/site stuff on hold until I get some other "less disruptive" modifications accepted (see https://github.com/spf13/cobra/pulls/umarcor). We are heading for a release (see #1496) and I listed all my ready-to-merge PRs there.

Then, I'll focus on #1428 (subset of this), #1245 (this) and #1430.

I'd be glad if you could review and maybe approve #1245 and #1430. The latter is not strictly related to the doc/site, but it is a minor reorganisation of the codebase.

@github-actions github-actions bot added area/docs-generation Generation of docs via Cobra admin For general admin tasks to be done usualy by maintainers labels Nov 3, 2021
@umarcor
Copy link
Contributor Author

umarcor commented Feb 25, 2022

This PR is not stale, but blocked by #1428. Please, remove the kind/stale label.
See #1245 (comment).

@jpmcb jpmcb added the kind/documentation Documentation of cobra itself label May 10, 2022
hoshsadiq added a commit to zulucmd/zulu that referenced this pull request Dec 31, 2022
…e with [Hugo](https://gohugo.io/) and deploying it to GitHub Pages (branch `gh-pages`).

- The content of the README is split to multiple markdown sources.
- Markdown sources from the root and from subdir `doc` are moved to `site/content` .
  - Documentation sources regarding completions are placed in `site/content/completions`.
  - Documentation sources regarding documentation generation are placed in `site/content/docgen`.
- Hugo configuration files are added to `site`. @bep's [docuapi](https://github.com/bep/docuapi) theme is used.
- In a GitHub Actions workflow, Hugo is installed, the theme is installed, the site is built, and the site is uploaded as an artifact as well as pushed to branch `gh-pages`.
- The logo from the README is used in the site (with a different font color).
- Any contributor that forks the repo and pushes some change, will have the site automatically built and uploaded to `username.github.io/cobra`.

See:

- Proposed README: https://github.com/umarcor/cobra/blob/ci-site/README.md
- Proposed site: https://umarcor.github.io/cobra
- Example CI run: https://github.com/umarcor/cobra/actions/runs/288401296 (note the artifact)

Ref #985 #1243 #1244

Merge spf13/cobra#1245
@github-actions github-actions bot added the area/github For changes to Github specific things not shipped in the library label Jun 20, 2023
@github-actions
Copy link

This PR exceeds the recommended size of 200 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

@umarcor umarcor marked this pull request as draft June 20, 2023 17:45
@github-actions github-actions bot removed the area/docs-generation Generation of docs via Cobra label Jun 20, 2023
@github-actions
Copy link

This PR exceeds the recommended size of 200 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

@github-actions
Copy link

This PR exceeds the recommended size of 200 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

@github-actions
Copy link

This PR exceeds the recommended size of 200 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

@github-actions
Copy link

This PR exceeds the recommended size of 200 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

@github-actions
Copy link

This PR exceeds the recommended size of 200 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
admin For general admin tasks to be done usualy by maintainers area/github For changes to Github specific things not shipped in the library kind/documentation Documentation of cobra itself
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants