mirror of
https://github.com/soapingtime/diyhrt.git
synced 2026-03-23 07:36:38 +00:00
37 lines
1.1 KiB
YAML
37 lines
1.1 KiB
YAML
name: HRTCafe.net
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
schedule:
|
|
- cron: "0 0 * * 0"
|
|
|
|
jobs:
|
|
download:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
token: ${{ secrets.PAT_TOKEN }}
|
|
- name: check for 404
|
|
run: |
|
|
url="https://hrtcafe.net"
|
|
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 .cafe
|
|
if: always()
|
|
run: |
|
|
rm -rf diyhrt.cafe
|
|
rm -rf hrtcafe.net
|
|
wget -rk --limit-rate 10m --random-wait --user-agent="github.com/soapingtime/diyhrt" --domains=hrtcafe.net https://hrtcafe.net || true
|
|
- name: commit changes
|
|
if: ${{ success() }}
|
|
uses: EndBug/add-and-commit@v9
|
|
with:
|
|
add: "diyhrt.cafe"
|
|
pull: "--rebase --autostash ."
|
|
message: "[automated] update diyhrt.cafe"
|
|
default_author: github_actions
|