Tor Radar #140
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: Tor Radar | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "17 */2 * * *" | |
| permissions: | |
| contents: write | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: tor-radar | |
| cancel-in-progress: false | |
| jobs: | |
| update: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Update Tor data | |
| env: | |
| TOR_RADAR_SNAPSHOT_RETENTION: "168" | |
| TOR_RADAR_HISTORY_RETENTION: "720" | |
| TOR_RADAR_DAN_REFRESH_HOURS: "12" | |
| TOR_RADAR_USER_AGENT: "TorRadar/0.1 (+${{ github.server_url }}/${{ github.repository }}; GitHub Actions public-data collector)" | |
| run: python3 scripts/update.py | |
| - name: Commit updated data | |
| uses: stefanzweifel/git-auto-commit-action@v5 | |
| with: | |
| commit_message: "Update Tor Radar data" | |
| file_pattern: "data" | |
| - name: Build Pages artifact | |
| run: | | |
| rm -rf site | |
| cp -R public site | |
| cp -R data site/data | |
| - name: Upload Pages artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: site | |
| deploy: | |
| needs: update | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |