DIYHRT.market #109
This file contains hidden or 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: DIYHRT.market | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0 * * 1" | |
jobs: | |
archive: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.PAT_TOKEN }} | |
- name: check for 404 | |
run: | | |
url="https://diyhrt.market" | |
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.market | |
run: | | |
rm -rf diyhrt.market cdn.diyhrt.market | |
wget -mkpKEH --limit-rate 10m --random-wait --user-agent="github.com/soapingtime/diyhrt" --domains=diyhrt.market,cdn.diyhrt.market https://diyhrt.market || true | |
find . -name "*.orig" -type f -delete | |
- name: commit changes | |
if: ${{ success() }} | |
uses: EndBug/add-and-commit@v9 | |
with: | |
add: "['diyhrt.market', 'cdn.diyhrt.market']" | |
pull: "--rebase --autostash ." | |
message: "[automated] update diyhrt.market" | |
default_author: github_actions |