Skip to content

Commit 633144f

Browse files
removed requirements.txt and simplified README
1 parent 7403b97 commit 633144f

File tree

2 files changed

+4
-39
lines changed

2 files changed

+4
-39
lines changed

README.md

Lines changed: 4 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -87,47 +87,17 @@ If a password is defined in an article, it will **ALWAYS** overwrite the global
8787

8888
### Github secret
8989

90-
Instead of specifying a password in the mkdocs.yml file, you can use a Github secret coupled to a Github worflow action.
91-
This requires a requirements.txt in order to install everything required to build the docs.
90+
Instead of specifying a password in the mkdocs.yml file, you can use a Github secret coupled to a CI/CD pipeline. This process is in two steps:
9291

93-
1. Go to the repo containing the doc you want to protect. Then go to `Settings > Secrets > Actions > New repository secret`.
94-
2. Name the secret `PASSWORD` and specify the the secret value you want to use.
95-
3. Go to `Actions > New workflow > set up a workflow yourself` and write the following in the yaml file (name it as you like and take care
96-
of the requirements.txt path):
92+
1. First, you need to make an environment variable containing your password accessible at runtime (through any CI/CD pipeline).
9793

98-
```yaml
99-
name: ci
100-
101-
on:
102-
push:
103-
branches:
104-
- main
105-
106-
env:
107-
PASSWORD: "${{ secrets.PASSWORD }}"
108-
109-
jobs:
110-
build:
111-
runs-on: ubuntu-latest
112-
steps:
113-
- name: Checkout main
114-
uses: actions/[email protected]
115-
- name: Setup python
116-
uses: actions/setup-python@v2
117-
with:
118-
python-version: 3.x
119-
- name: Deploy
120-
run: |
121-
pip install -r ./docs/requirements.txt
122-
mkdocs gh-deploy --force
123-
```
12494

125-
4. Finally, in the mkdocs.yml file, instead of specifying a global password, simply put the `use_secret` field to true:
95+
4. Finally, in the mkdocs.yml file, instead of specifying a global password, simply set the `use_secret` field to the name of your environment variable, e.g. in the case where my secret is stored in the $PASSWORD` variable:
12696

12797
```yaml
12898
plugins:
12999
- encryptcontent:
130-
use_secret: true
100+
use_secret: 'PASSWORD'
131101
```
132102

133103

requirements.txt

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)