-
Notifications
You must be signed in to change notification settings - Fork 2
40 lines (36 loc) · 1.12 KB
/
backup-files.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
# This workflow will run the "tools/file_fetcher.py" script once a day, while
# also committing any changes to the repository.
name: Scan for new API assets
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch: {}
jobs:
backup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install aiohttp aiofiles yarl
- name: Configure git
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
- name: Run file fetcher
run: |
python tools/file_fetcher.py ./images incremental --count 1000
- name: Filter changes
run: |
git add images
git stash save --keep-index --include-untracked
- name: Commit and push relevant changes
continue-on-error: true
run: |
git commit -m "Automatic Asset Update"
git push origin main