-
Notifications
You must be signed in to change notification settings - Fork 214
46 lines (39 loc) · 1.14 KB
/
update-downloads.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
46
name: Update Downloads
on:
push:
paths:
- 'content/**'
jobs:
update-downloads:
runs-on: ubuntu-latest
steps:
- name: Checkout Notebooks repo
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install zip
run: sudo apt-get install zip
- name: Zip content directories
run: |
cd content
for dir in week*; do
zip -r "../$dir.zip" "$dir" -X -q -x "*.git*"
done
cd ..
- name: Checkout Downloads repo
uses: actions/checkout@v2
with:
repository: PythonFreeCourse/downloads
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
path: downloads
- name: Copy zip files to Downloads repo
run: |
cp *.zip downloads/
- name: Commit and push changes
run: |
cd downloads
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor }}@users.noreply.github.com"
git add -A .
git commit -m "Update zip files by ${{ github.actor }}" || echo "No changes to commit"
git push