-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GitHub Actions and Custom Directory sections to the Publishing do…
…cs page (#160)
- Loading branch information
Showing
1 changed file
with
35 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,8 @@ 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. | ||
|
||
Additionally, you can also specify the `--out-dir [path]` argument to set the build directory to a different path other than the default `build` directory. | ||
|
||
:::caution | ||
Remember to add the `build` folder to your `.gitignore`! | ||
::: | ||
|
@@ -46,4 +48,36 @@ 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. | ||
|
||
## Using GitHub Actions | ||
|
||
You can create a GitHub Actions workflow to automatically publish your docs webiste to GitHub Pages. To begin, you need to create a new workflow in the `.github/workflows` directory of your repository that will build and publish your website. | ||
|
||
Here is an example of such a workflow where the job will run on each push to the `master` branch: | ||
|
||
```yaml | ||
# .github/workflows/publish-docs.yml | ||
name: publish-docs | ||
on: | ||
push: | ||
branches: ["master"] | ||
jobs: | ||
status: | ||
runs-on: ubuntu-latest | ||
name: Publish docs to GitHub Pages | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: "22" | ||
- run: npm i -g moonwave@latest | ||
- name: Publish | ||
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 "github-actions-bot" | ||
moonwave build --publish | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
``` |