revert lockfile #110
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: Scrape YouTube, Twitch Channels, and GitHub Contributors | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
scrape: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
pip install requests beautifulsoup4 | |
- name: Run YouTube scraping script | |
run: | | |
python src/assets/misc/scrapyb.py | |
- name: Display YouTube JSON content | |
run: | | |
cat src/assets/misc/channels_info.json | |
- name: Run Twitch scraping script | |
run: | | |
python src/assets/misc/scraptwitch.py | |
- name: Display Twitch JSON content | |
run: | | |
cat src/assets/misc/twitch_channels_info.json | |
- name: Run GitHub contributors scraping script | |
run: | | |
python src/assets/misc/scrapcontributors.py | |
- name: Display GitHub contributors JSON content | |
run: | | |
cat src/assets/cards.json | |
- name: Run Discord scraping script | |
run: | | |
python src/assets/misc/scrapdiscord.py | |
- name: Display Discord JSON content | |
run: | | |
cat src/assets/misc/discord_servers_info.json | |
- name: Check if JSON files have changed | |
run: | | |
git diff --exit-code src/assets/misc/channels_info.json src/assets/misc/twitch_channels_info.json src/assets/cards.json src/assets/misc/discord_servers_info.json | |
id: changes_check | |
continue-on-error: true | |
- name: Commit and push changes if files changed | |
if: steps.changes_check.outcome == 'failure' | |
run: | | |
git config --local user.name "github-actions" | |
git config --local user.email "[email protected]" | |
git add src/assets/misc/channels_info.json src/assets/misc/twitch_channels_info.json src/assets/cards.json src/assets/misc/discord_servers_info.json | |
git commit -m "Update JSON files from GitHub Actions" | |
git push origin main |