Skip to content

Commit

Permalink
update doc locally
Browse files Browse the repository at this point in the history
  • Loading branch information
pedro terzero committed Sep 10, 2024
1 parent 8f572c2 commit 65a2bb5
Show file tree
Hide file tree
Showing 3 changed files with 14,400 additions and 25 deletions.
51 changes: 26 additions & 25 deletions .github/workflows/update-doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,46 +3,49 @@ name: Update documentation

on:
schedule:
- cron: '0 2 * * *'
- cron: "0 2 * * *"
workflow_dispatch:
inputs:
use_local_ruleset_file:
description: "Use local ruleset.html? (default: false)"
required: false
default: "false"

# push:
# branches:
# - master


# simple job that checks out a repo
jobs:
update-doc:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v4
with:
repository: pedroterzero/oxce-ruleset-scraper
# https://github.com/settings/tokens?type=beta
token: ${{ secrets.GIT_SCRAPER_TOKEN }}
-
name: Install Node.js
uses: actions/setup-node@v3

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 18
-
run: npm install
-
name: Retrieve wiki page
node-version: 20

- run: npm install

- name: Retrieve wiki page
run: |
URL='https://www.ufopaedia.org/index.php/Ruleset_Reference_Nightly_(OpenXcom)'
wget --timeout=30 --tries=3 -O ruleset.html "$URL" || curl -Lf -o ruleset.html "https://web.archive.org/$URL"
if: ${{ github.event.inputs.use_local_ruleset_file != 'false' }}

-
name: Parse the wiki page
- name: Parse the wiki page
run: npm run start

# store doc.json as artifact
- name: Store artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: doc.json
path: doc.json
Expand All @@ -51,21 +54,19 @@ jobs:
needs: update-doc
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Download artifact
uses: actions/download-artifact@v3
- name: Checkout
uses: actions/checkout@v4

- name: Download artifact
uses: actions/download-artifact@v4
with:
name: doc.json
path: src/assets
-
name: Commit changes

- name: Commit changes
run: |
git config --local user.email "pedro@pedro"
git config --local user.name "Github Actions"
git add src/assets/doc.json
git commit -m "Update doc.json" -a || echo "No changes to commit"
git push
23 changes: 23 additions & 0 deletions get-ruleset-documentation.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
curl 'https://www.ufopaedia.org/index.php/Ruleset_Reference_Nightly_(OpenXcom)' \
-o ruleset.html \
-H 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7' \
-H 'accept-language: en-GB,en;q=0.9,en-US;q=0.8' \
-H 'cache-control: no-cache' \
-H 'cookie: cf_clearance=.DqEi2PBv7cdZXFqUXOntkiEOl.ppkTrVfdZzgZL_rE-1725972650-1.2.1.1-hDaPdtlkBOwU24r8VEoDvQmmeUTCTIyeiPBhTySL.s79QtYnXqbLE9N0AjDPUcVZe1HIHyy.F8X1fXotaVgCY1vTiDzrHsn9EoIJd_sh12Y_CZLrqoMtdUR79k1Bqk2s5F1b1IdCCgRPgYr7RP5M35bacCVheAHbOLCuUQ5GZkoEd3iIxaS_Vaoie4bW0qQVPD8RkTLONtyUwC9diaoo2OxO.NwCw5caghUpTpMkSfV5DahykGitc4dBCkgP__XIjNILh73qQcvW_dMMhZIh_ZuFU5WZb3_npQ_7SG6vVnMT0i63zqVbMYbSQU_S1SIqqA8FPAA.JDXM6hgMQiMFlUw7TEOikWJ5BMLBrFFutlU8pUW8ZqLCrfWDRClUlOLO8yCH6.B0jUdiiyKPzdsS5QU5iEs5MLSkiBd00TXhESDeq_AaPr8WRv7aJcJBnKxJ' \
-H 'pragma: no-cache' \
-H 'priority: u=0, i' \
-H 'sec-ch-ua: "Not/A)Brand";v="8", "Chromium";v="126", "Microsoft Edge";v="126"' \
-H 'sec-ch-ua-arch: "x86"' \
-H 'sec-ch-ua-bitness: "64"' \
-H 'sec-ch-ua-full-version: "126.0.2592.68"' \
-H 'sec-ch-ua-full-version-list: "Not/A)Brand";v="8.0.0.0", "Chromium";v="126.0.6478.114", "Microsoft Edge";v="126.0.2592.68"' \
-H 'sec-ch-ua-mobile: ?0' \
-H 'sec-ch-ua-model: ""' \
-H 'sec-ch-ua-platform: "Linux"' \
-H 'sec-ch-ua-platform-version: "6.5.0"' \
-H 'sec-fetch-dest: document' \
-H 'sec-fetch-mode: navigate' \
-H 'sec-fetch-site: none' \
-H 'sec-fetch-user: ?1' \
-H 'upgrade-insecure-requests: 1' \
-H 'user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0'
Loading

0 comments on commit 65a2bb5

Please sign in to comment.