From 50bf78d8081f10f9089ceb134f3fe8236f1928fb Mon Sep 17 00:00:00 2001 From: David Park <9065463+dp247@users.noreply.github.com> Date: Fri, 28 Feb 2025 13:00:50 +0000 Subject: [PATCH] Create wiki.yml --- .github/workflows/wiki.yml | 52 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/wiki.yml diff --git a/.github/workflows/wiki.yml b/.github/workflows/wiki.yml new file mode 100644 index 0000000..eac77d4 --- /dev/null +++ b/.github/workflows/wiki.yml @@ -0,0 +1,52 @@ +name: deploy-wiki +on: + schedule: + - cron: '0 */8 * * *' + push: + branches: "master" + paths: wiki/** +jobs: + json-to-md: + runs-on: ubuntu-latest + steps: + - name: Get current date + id: date + run: echo "RUN_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV + + - name: checkout repo content + uses: actions/checkout@v4 + + - name: pull changes + run: | + git fetch --prune + git reset --hard origin/main + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.10" + + - name: execute py script + run: python jsontomd.py + + - name: commit files + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git add -A + git diff-index --quiet HEAD || (git commit -a -m "Updated channels.md on $RUN_DATE" --allow-empty) + + - name: push changes + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: master + + deploy-wiki: + permissions: + contents: write + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions4gh/configure-wiki@v1 + - uses: actions4gh/deploy-wiki@v1