Scrape and push #666
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 and push | |
on: | |
schedule: | |
- cron: "0 0 * * *" | |
# runs daily at midnight | |
workflow_dispatch: | |
env: | |
EMAIL: ${{ secrets.EMAIL }} | |
NAME: ${{ secrets.NAME }} | |
jobs: | |
report: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v3 | |
- name: List files in the repository | |
run: | | |
ls ${{ github.workspace }} | |
- name: install dependencies | |
run: pip install -r requirements.txt | |
- name: Scrape all jobs | |
run: python3 scrape-all-jobs.py | |
shell: bash | |
- name: Save Time | |
run: | | |
echo "TIME=$(TZ=America/Los_Angeles date +'%m/%d/%Y %H:%M %Z')" >> $GITHUB_ENV | |
# echo "time2=$(date +"%Y-%m-%d")" >> $GITHUB_ENV | |
- name: Check if there are any changes | |
id: verify_diff | |
run: | | |
git diff --quiet . || echo "changed=true" >> $GITHUB_OUTPUT | |
- name: Commit files | |
if: steps.verify_diff.outputs.changed == 'true' | |
run: | | |
git config --local user.email ${{ env.EMAIL }} | |
git config --local user.name ${{ env.NAME }} | |
git commit -a -m "adding new jobs on ${{ env.TIME }}" | |
- name: GitHub Push | |
uses: ad-m/github-push-action@v0.6.0 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: main | |
# - run: echo "🍏 This job's status is ${{ job.status }}." |