mirror of
https://github.com/soapingtime/diyhrt.git
synced 2026-11-01 15:04:51 +01:00
re-initialize and make some changes. repository got to around 2 gigabytes and needed to be more efficient
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
name: DIYHRT.wiki
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: "0 0 * * 2"
|
||||
|
||||
jobs:
|
||||
archive:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
token: ${{ secrets.PAT_TOKEN }}
|
||||
- name: check for 404
|
||||
run: |
|
||||
url="https://diyhrt.wiki"
|
||||
status=$(curl -o /dev/null -s -w "%{http_code}" $url)
|
||||
if [ $status -eq 404 ]; then
|
||||
echo "Got 404. Exiting."
|
||||
curl -H "Content-Type: application/json" -d '{"content": "${{ secrets.DISCORD_USER_ID }} $URL returned 404"}' ${{ secrets.WEBHOOK_URL }}
|
||||
exit 1
|
||||
fi
|
||||
- name: download diyhrt.wiki
|
||||
run: |
|
||||
rm -rf diyhrt.wiki
|
||||
wget -mkxKE -e robots=off --limit-rate=10m --random-wait --user-agent="Contact: hrt.boytw.ink/crawl_contact.txt" --reject '*age-check*' https://diyhrt.wiki https://diyhrt.wiki/nav.html || true # downloads nav.html because it doesn't crawl properly without it
|
||||
cd diyhrt.wiki && rm *.orig && cd ..
|
||||
- name: setup python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.10'
|
||||
- name: run agebypass.py # removes the age-check.js script because it was causing problems
|
||||
run: python scripts/agebypass.py
|
||||
- name: commit changes
|
||||
if: ${{ success() }}
|
||||
uses: EndBug/add-and-commit@v9
|
||||
with:
|
||||
add: "diyhrt.wiki"
|
||||
pull: "--rebase --autostash ."
|
||||
message: "[automated] update diyhrt.wiki"
|
||||
default_author: github_actions
|
||||
Reference in New Issue
Block a user