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

Add GitHub Actions and custom dir sections to Publish doc page #160

Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion website/docs/Publishing.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,21 @@ If you are using git and Github pages, you can publish your doc website with one

Otherwise, you can run `moonwave build`, and your built website will be in a folder called `build` in your project directory.

## Using GitHub Actions

When you publish your doc via GitHub Actions you might need to provide the author details and GitHub token.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't actually need to provide your own email and username, you can just provide the GitHub Actions username and email, github-actions-bot and [email protected].

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah maybe you're right. I assumed the same (usually works fine with mock bot address) but got "Failed to get the author data" errors. Maybe it was just me and by default the workflow is just fine with mock author data.


```yaml
- name: Publish
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would include the full example of a Moonwave GitHub Action, and move it down on the page since it has low importance. It's nice to include a working example of things to prevent confusion, we can also specify where they should put this in their repository in the description for this section.

run: |
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
moonwave build --publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```

:::caution
Remember to add the `build` folder to your `.gitignore`!
:::
Expand Down Expand Up @@ -46,4 +61,12 @@ Even if you are using Github Pages, and:

## Github Pages Custom Domain CNAME file

Github Pages requires you to create a CNAME file in your website to host on a custom domain. You should create this file at `yourProjectRoot/.moonwave/static/CNAME` (create the folders if they don't exist) and put your domain in the file.
Github Pages requires you to create a CNAME file in your website to host on a custom domain. You should create this file at `yourProjectRoot/.moonwave/static/CNAME` (create the folders if they don't exist) and put your domain in the file.

## Custom build directory

You can set a custom build directory instead of the default `build` if needed by passing the `--out-dir` argument to `moonwave build` command.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would make more sense to mention the --out-dir flag briefly here instead of creating a new section for it. Just something saying, "Or you can specify --out-dir [path] to set the build directory to a different path"


```sh
moonwave --out-dir=custom_dir build
```