From 6835711d91b460e3a42f40fd3dd49ad003abbb35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luka=20Simi=C4=87?= Date: Tue, 27 Aug 2024 23:48:42 +0200 Subject: [PATCH] Add GitHub Actions workflows for fandom-cron. --- .github/workflows/dump.yml | 29 +++++++++++++++++++++++++++++ .github/workflows/highlight.yml | 26 ++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 .github/workflows/dump.yml create mode 100644 .github/workflows/highlight.yml diff --git a/.github/workflows/dump.yml b/.github/workflows/dump.yml new file mode 100644 index 0000000..0ec4601 --- /dev/null +++ b/.github/workflows/dump.yml @@ -0,0 +1,29 @@ +name: Dump all wiki databases + +on: + schedule: + - cron: '43 0 * * *' + workflow_dispatch: + +jobs: + dump: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: '22' + - name: Install dependencies + working-directory: ./fandom-cron + run: npm install + - name: Set configuration + working-directory: ./fandom-cron + run: echo '${{ secrets.DUMP_CONFIG }}' > dump.json + - name: Set cookies + working-directory: ./fandom-cron + run: echo '${{ secrets.DUMP_COOKIES }}' > fandom.cookies + - name: Dump the databases + working-directory: ./fandom-cron + run: node dump.js diff --git a/.github/workflows/highlight.yml b/.github/workflows/highlight.yml new file mode 100644 index 0000000..492d55d --- /dev/null +++ b/.github/workflows/highlight.yml @@ -0,0 +1,26 @@ +name: Update Highlight.css + +on: + schedule: + - cron: '36 0 * * *' + workflow_dispatch: + +jobs: + highlight: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: '22' + - name: Install dependencies + working-directory: ./fandom-cron + run: npm install + - name: Set configuration + working-directory: ./fandom-cron + run: echo '${{ secrets.HIGHLIGHT_CONFIG }}' > highlight.json + - name: Update Highlight.css + working-directory: ./fandom-cron + run: node highlight.js