From 5d933b5a4a0dad932062340796ba5e1607031673 Mon Sep 17 00:00:00 2001 From: Michel Zehnder Date: Tue, 25 Apr 2023 15:10:29 +0200 Subject: [PATCH 1/2] Add Wiki Build Add Wiki Build for nlog-project.org --- .github/workflows/build-wiki.yml | 38 ++++++++++++++++++++++++++++++++ _wiki/mkdocs.yml | 16 ++++++++++++++ _wiki/requirements.txt | 4 ++++ _wiki/wiki-src | 1 + 4 files changed, 59 insertions(+) create mode 100644 .github/workflows/build-wiki.yml create mode 100644 _wiki/mkdocs.yml create mode 100644 _wiki/requirements.txt create mode 160000 _wiki/wiki-src diff --git a/.github/workflows/build-wiki.yml b/.github/workflows/build-wiki.yml new file mode 100644 index 000000000..47d4fc23f --- /dev/null +++ b/.github/workflows/build-wiki.yml @@ -0,0 +1,38 @@ +name: 'Build Wiki' + +on: + repository_dispatch: + types: [build-wiki] + workflow_dispatch: + +jobs: + check: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Checkout wiki repo + uses: actions/checkout@v3 + with: + repository: NLog/NLog.wiki + path: _wiki/wiki-src + - uses: actions/setup-python@v4 + with: + python-version: '3.11' + - run: pip install -r _wiki/requirements.txt + - run: mkdocs build --config-file _wiki/mkdocs.yml + - name: Commit files + run: | + cd ./wiki + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git add ./ + git commit -m "Build Wiki" -a + - name: Push changes + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: master + directory: ./wiki diff --git a/_wiki/mkdocs.yml b/_wiki/mkdocs.yml new file mode 100644 index 000000000..1c3ea469e --- /dev/null +++ b/_wiki/mkdocs.yml @@ -0,0 +1,16 @@ +site_name: NLog Wiki +site_url: https://nlog-project.org/wiki +repo_url: https://github.com/NLog/NLog/wiki +docs_dir: wiki-src +site_dir: ../wiki +strict: false +plugins: + - search + - ezlinks + - github-wiki-edit-url + - redirects: + redirect_maps: + index.md: Home.md +theme: + name: readthedocs + logo: https://nlog-project.org/images/NLog-logo-only_small.png \ No newline at end of file diff --git a/_wiki/requirements.txt b/_wiki/requirements.txt new file mode 100644 index 000000000..f6b6a08c3 --- /dev/null +++ b/_wiki/requirements.txt @@ -0,0 +1,4 @@ +mkdocs +mkdocs-ezlinks-plugin +mkdocs-github-wiki-edit-url +mkdocs-redirects \ No newline at end of file diff --git a/_wiki/wiki-src b/_wiki/wiki-src new file mode 160000 index 000000000..4a5cd5ee0 --- /dev/null +++ b/_wiki/wiki-src @@ -0,0 +1 @@ +Subproject commit 4a5cd5ee03c509866f0f8ee91f5fc5110a9910d1 From 29665354cf073b78aa7f1ef1a39a7467e624a222 Mon Sep 17 00:00:00 2001 From: Julian Verdurmen <5808377+304NotModified@users.noreply.github.com> Date: Tue, 10 Nov 2026 23:55:22 +0100 Subject: [PATCH 2/2] Change to PR, update versions --- .github/workflows/build-wiki.yml | 41 +++++++++++++++++++------------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build-wiki.yml b/.github/workflows/build-wiki.yml index 47d4fc23f..3109ecb38 100644 --- a/.github/workflows/build-wiki.yml +++ b/.github/workflows/build-wiki.yml @@ -1,38 +1,45 @@ name: 'Build Wiki' -on: +on: repository_dispatch: types: [build-wiki] workflow_dispatch: +permissions: + contents: read + jobs: check: runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: + ref: master fetch-depth: 0 + persist-credentials: false - name: Checkout wiki repo - uses: actions/checkout@v3 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: repository: NLog/NLog.wiki path: _wiki/wiki-src - - uses: actions/setup-python@v4 + persist-credentials: false + - uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0 with: - python-version: '3.11' + python-version: '3.15' - run: pip install -r _wiki/requirements.txt - run: mkdocs build --config-file _wiki/mkdocs.yml - - name: Commit files - run: | - cd ./wiki - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" - git add ./ - git commit -m "Build Wiki" -a - - name: Push changes - uses: ad-m/github-push-action@master + - name: Create or update pull request + uses: peter-evans/create-pull-request@3ffccacd46053766916f087ce41d627c0b8cf2d1 # v8.1.3 with: - github_token: ${{ secrets.GITHUB_TOKEN }} - branch: master - directory: ./wiki + token: ${{ github.token }} + add-paths: wiki/ + branch: build-wiki + commit-message: Update Wiki + author: 'NLog.github.io Action ' + committer: 'NLog.github.io Action ' + title: Update Wiki + body: 'Automated update of the generated wiki site.' \ No newline at end of file