-
Notifications
You must be signed in to change notification settings - Fork 19
45 lines (38 loc) · 1.08 KB
/
update.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Update Schedule
on:
push:
branches:
- main
schedule:
- cron: '0 0 * * 1'
workflow_dispatch:
permissions:
contents: write
jobs:
update-this-week:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Install requirements
run: pip install -r requirements.txt
- name: Execute Python Script
run: |
cd docs/_data
python3 update_this_week.py
- name: Commit files
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git diff --exit-code || (git add -A && git commit -m "Update weekly schedule" -a)
- name: Push changes
uses: ad-m/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: main
deploy-website:
if: ${{ github.event_name != 'push' }} # Push events run deploy already
needs: update-this-week
uses: ./.github/workflows/deploy.yml