Update Proxy Configs #344
This file contains 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: Update Proxy Configs | |
on: | |
schedule: | |
- cron: '0 * * * *' | |
workflow_dispatch: | |
permissions: | |
contents: write | |
jobs: | |
update-configs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Create directories | |
run: | | |
mkdir -p assets | |
mkdir -p configs | |
- name: Run config fetcher | |
run: python src/fetch_configs.py | |
continue-on-error: true | |
- name: Generate charts and reports | |
run: python src/generate_charts.py | |
- name: Update README timestamps | |
run: | | |
timestamp=$(date +%s) | |
sed -i "s/channel_stats_chart\.svg?v=[0-9]*/channel_stats_chart.svg?v=$timestamp/" README.md | |
sed -i "s/performance_report\.html?v=[0-9]*/performance_report.html?v=$timestamp/" README.md | |
- name: Setup Git | |
run: | | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
- name: Commit and push changes | |
run: | | |
git add configs/proxy_configs.txt | |
git add configs/channel_stats.json | |
git add assets/channel_stats_chart.svg | |
git add assets/performance_report.html | |
git add README.md | |
git commit -m "Update proxy configs, stats and reports" || echo "No changes to commit" | |
git push |