2020-05-21 22:28:22 +00:00
|
|
|
name: Build
|
|
|
|
on:
|
|
|
|
push:
|
2020-05-21 22:38:47 +00:00
|
|
|
branches:
|
|
|
|
- master
|
2023-10-19 23:03:13 +00:00
|
|
|
paths: # Only build if these files were modified
|
|
|
|
- src/yaml/*.yml
|
|
|
|
- src/md/*.md
|
|
|
|
- src/_build.js
|
|
|
|
- src/_wiki.js
|
2020-05-21 22:28:22 +00:00
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-10-19 23:03:13 +00:00
|
|
|
- uses: actions/checkout@v4
|
2020-05-21 22:28:22 +00:00
|
|
|
with:
|
2023-10-19 23:03:13 +00:00
|
|
|
# GH_PAT must be a PAT for repo owner
|
|
|
|
token: ${{ secrets.GH_PAT }}
|
|
|
|
- uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
node-version: 20.x
|
|
|
|
- name: Build README
|
|
|
|
run: npm i && node src/_build.js
|
|
|
|
- name: Commit & Push
|
|
|
|
# GH_NAME/GH_EMAIL can be any collaborator account with Force Push access
|
2020-05-21 22:28:22 +00:00
|
|
|
run: |
|
2020-05-24 00:36:32 +00:00
|
|
|
git add README.md
|
2023-10-19 23:03:13 +00:00
|
|
|
git config --local user.name "${{ vars.GH_NAME }}"
|
|
|
|
git config --local user.email "${{ vars.GH_EMAIL }}"
|
2021-08-08 00:06:49 +00:00
|
|
|
git commit --allow-empty -m "Generated README.md"
|
2023-10-19 23:03:13 +00:00
|
|
|
git push --force-with-lease
|
|
|
|
- name: Publish Reddit Wiki
|
|
|
|
run: node src/_wiki.js
|
2020-06-02 21:20:31 +00:00
|
|
|
env:
|
|
|
|
REDDIT_USER: ${{ secrets.REDDIT_USER}}
|
|
|
|
REDDIT_PASS: ${{ secrets.REDDIT_PASS}}
|
|
|
|
REDDIT_CLIENT_ID: ${{ secrets.REDDIT_CLIENT_ID}}
|
2021-08-08 00:06:49 +00:00
|
|
|
REDDIT_CLIENT_SECRET: ${{ secrets.REDDIT_CLIENT_SECRET}}
|