Do update #247
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Do update | |
on: | |
schedule: | |
- cron: '21 0 * * fri' | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pipenv | |
pipenv install | |
- name: Run | |
run: | | |
pipenv run python main.py | |
- name: Push to srn | |
env: | |
SSH_KEY: ${{ secrets.SRN_KEY }} | |
run: | | |
eval $(ssh-agent) | |
ssh-add <(echo "$SSH_KEY" | base64 -d) | |
mkdir -p ~/.ssh | |
ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts | |
BRANCH_NAME="wiki-data-$(date +"%Y-%m-%d")" | |
mkdir srn | |
cd srn | |
git init | |
git remote add upstream https://github.com/runelite/static.runelite.net.git | |
git remote add origin [email protected]:runelite/static.runelite.net.git | |
git fetch upstream | |
git checkout upstream/gh-pages | |
git checkout -b "$BRANCH_NAME" | |
mkdir -p item npcs | |
cp ../stats{,.ids.min}.json item/ | |
cp ../npcs{,.min}.json npcs | |
git add item/stats{,.ids.min}.json | |
git add npcs/npcs{,.min}.json | |
git -c user.name="RuneLite Wiki Scraper" -c user.email="[email protected]" commit -m "Update wiki data" || exit 0 | |
git push -u origin "$BRANCH_NAME" |