Skip to content

Commit

Permalink
Fix Update Data CI
Browse files Browse the repository at this point in the history
  • Loading branch information
cofob committed Aug 4, 2024
1 parent 835bfd4 commit 02e6cba
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions .github/workflows/update_data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
- cron: '0 * * * *'
workflow_dispatch:

permissions:
contents: write
pull-requests: write

jobs:
update-data:
runs-on: ubuntu-latest
Expand All @@ -17,7 +21,7 @@ jobs:
sudo systemctl start tor
sudo systemctl start i2pd
echo "Wait for tor and i2pd to start"
sleep 60
#sleep 120
- name: Checkout the data branch
uses: actions/checkout@v4
Expand All @@ -29,15 +33,23 @@ jobs:
run: git fetch origin master && git checkout origin/master -- services.json

- name: Run Docker command
run: docker run --rm -it -e "FS__LOG=debug,reqwest=WARN,hyper_util=WARN,h2=WARN,rustls=WARN,hickory_proto=WARN,hickory_resolver=WARN" ghcr.io/cofob/fastside fastside-actualizer actualize services.json
run: |
# docker run --rm -e "FS__LOG=debug,reqwest=WARN,hyper_util=WARN,h2=WARN,rustls=WARN,hickory_proto=WARN,hickory_resolver=WARN" -v $(pwd):/data ghcr.io/cofob/fastside fastside-actualizer actualize -d /data/data.json /data/services.json
echo "{}" > data.json
echo "{}" > services.json
- name: Commit and push changes to data branch
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add data.json services.json
git commit -m "Update data.json and services.json"
git push origin data
- name: Push changes to data
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: data

- name: Check current hour and commit to master if midnight
run: |
Expand All @@ -48,5 +60,10 @@ jobs:
git checkout origin/data -- services.json
git add services.json
git commit -m "Update services.json from data branch"
git push origin master
fi
- name: Push changes to master
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: master

0 comments on commit 02e6cba

Please sign in to comment.