You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+16-14Lines changed: 16 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,46 +10,47 @@ There are two methods for generating and building your `gh-pages` branch: use ei
10
10
11
11
### Building with `PERSONAL_TOKEN`
12
12
13
-
[Generate a personal access token (scope `repo`)](https://github.com/settings/tokens) and [create a secret](https://help.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets) in your repository settings with the name `PERSONAL_TOKEN` and the value of the token generated.
13
+
-[Generate a personal access token (scope `repo`)](https://github.com/settings/tokens) and [create a secret](https://help.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets) in your repository settings with the name `PERSONAL_TOKEN` and the value of the token generated.
14
14
15
-
Note that this is an account-level token that has access to update **any** repo owned by you, so be sure to avoid sharing it.
15
+
-Note that this is an account-level token that has access to update **any** repo owned by you, so be sure to avoid sharing it.
16
16
17
17
### Building with `GITHUB_TOKEN`
18
18
19
-
This action supports building and deploying with a `GITHUB_TOKEN`. This token is automatically generated by Github Actions when a workflow runs so it is convenient.
19
+
-This action supports building and deploying with a `GITHUB_TOKEN`. This token is automatically generated by Github Actions when a workflow runs so it is convenient.
20
20
21
-
It is more **secure** than a personal token, since you never actually see the value of the `GITHUB_TOKEN` and also the `GITHUB_TOKEN` is scoped to only work for a **single** repo.
21
+
-It is more **secure** than a personal token, since you never actually see the value of the `GITHUB_TOKEN` and also the `GITHUB_TOKEN` is scoped to only work for a **single** repo.
22
22
23
-
You may need to give the `GITHUB_TOKEN` write permission. Go to your repository's **Settings > Actions > General > Workflow Permissions** and select **Read and write permissions**.
23
+
-You may need to give the `GITHUB_TOKEN` write permission. Go to your repository's **Settings > Actions > General > Workflow Permissions** and select **Read and write permissions**.
24
24
25
-
Note that for this approach, Github Pages will be enabled in Settings but you will _not_ have a URL displayed or environment tab yet. So change the Github Pages settings to another target and then back again to `gh-pages` (if that is your branch to serve) - then you will see a URL. This step is only needed on the _first_ deploy and no action is needed later on.
25
+
-Note that for this approach, Github Pages will be enabled in Settings but you will _not_ have a URL displayed or environment tab yet. So change the Github Pages settings to another target and then back again to `gh-pages` (if that is your branch to serve) - then you will see a URL. This step is only needed on the _first_ deploy and no action is needed later on.
26
26
27
27
### Alternative `GITHUB_DOMAIN`
28
28
29
-
In case this action should be used in a Github Enterprise environment you can overwrite the `github.com` domain with your corresponding Github Enterprise domain name by specifying the `GITHUB_DOMAIN` environment variable.
29
+
-In case this action should be used in a Github Enterprise environment you can overwrite the `github.com` domain with your corresponding Github Enterprise domain name by specifying the `GITHUB_DOMAIN` environment variable.
30
30
31
-
### Custom domain for github pages
31
+
### Building with `CUSTOM_DOMAIN`for Github Pages
32
32
33
-
MkDocs can be deployed to github pages using a custom domain, if you populate a `CUSTOM_DOMAIN` environment variable. This will generate a CNAME file, which will be placed inside the `/docs` folder.
33
+
- MkDocs can be deployed to github pages using a custom domain, if you populate a `CUSTOM_DOMAIN` environment variable. This will generate a CNAME file, which by default will be placed inside the `/docs` folder.
34
+
- Using the ``CUSTOM_DOCS`` environment variable will change this folder, and should match the ``docs_dir`` in your ``mkdocs.yml``file.
This action supports deployment of mkdocs with different file path , if you populate a `CONFIG_FILE` environment variable. This is important if you have mkdocs file in another folder such as if you have `mkdocs.yml` in a path `docs/mkdocs.yml`. Without populating this, the deployment assumes that `mkdocs.yml` is on the root folder.
40
+
-This action supports deployment of mkdocs with different file path , if you populate a `CONFIG_FILE` environment variable. This is important if you have mkdocs file in another folder such as if you have `mkdocs.yml` in a path `docs/mkdocs.yml`. Without populating this, the deployment assumes that `mkdocs.yml` is on the root folder.
40
41
41
42
## Installing extra packages
42
43
43
-
Some Python packages require C bindings. These packages can be installed using the `EXTRA_PACKAGES` variable. The `EXTRA_PACKAGES` variable will be passed to the `apk add` command of Alpine Linux before running `pip install` to install the Python packages.
44
+
-Some Python packages require C bindings. These packages can be installed using the `EXTRA_PACKAGES` variable. The `EXTRA_PACKAGES` variable will be passed to the `apk add` command of Alpine Linux before running `pip install` to install the Python packages.
44
45
45
46
## Installing mkdocs plugins
46
47
47
-
If you use some mkdocs plugins like [`codeinclude`](https://github.com/rnorth/mkdocs-codeinclude-plugin) then you need to define it as dependency in the typical python way with a `requirements.txt` file. In the sample above you need to add the line `mkdocs-codeinclude-plugin`. Then you need to link the file using the `REQUIREMENTS` variable.
48
+
-If you use some mkdocs plugins like [`codeinclude`](https://github.com/rnorth/mkdocs-codeinclude-plugin) then you need to define it as dependency in the typical python way with a `requirements.txt` file. In the sample above you need to add the line `mkdocs-codeinclude-plugin`. Then you need to link the file using the `REQUIREMENTS` variable.
48
49
49
50
## Example usage
50
51
51
-
```shell
52
-
name: Publish docs via GitHub Pages
52
+
```yml
53
+
name: Publish Docs via GitHub Pages
53
54
on:
54
55
push:
55
56
branches:
@@ -69,6 +70,7 @@ jobs:
69
70
env:
70
71
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
71
72
CUSTOM_DOMAIN: optionaldomain.com
73
+
CUSTOM_DOCS: coolfolder # Only used if CUSTOM_DOMAIN and a custom 'docs_dir' are set
0 commit comments