Skip to content

Commit ca8940b

Browse files
authoredFeb 17, 2024
feat: Autoupdate /downloads repo
1 parent 09cf0d8 commit ca8940b

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed
 
+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Update Downloads
2+
3+
on:
4+
push:
5+
paths:
6+
- 'content/**'
7+
8+
jobs:
9+
update-downloads:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout Notebooks repo
13+
uses: actions/checkout@v2
14+
with:
15+
fetch-depth: 0
16+
17+
- name: Install zip
18+
run: sudo apt-get install zip
19+
20+
- name: Zip content directories
21+
run: |
22+
cd content
23+
for dir in week*; do
24+
zip -r "../$dir.zip" "$dir" -X -q -x "*.git*"
25+
done
26+
cd ..
27+
28+
- name: Checkout Downloads repo
29+
uses: actions/checkout@v2
30+
with:
31+
repository: PythonFreeCourse/downloads
32+
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
33+
path: downloads
34+
35+
- name: Copy zip files to Downloads repo
36+
run: |
37+
cp *.zip downloads/
38+
39+
- name: Commit and push changes
40+
run: |
41+
cd downloads
42+
git config user.name "${{ github.actor }}"
43+
git config user.email "${{ github.actor }}@users.noreply.github.com"
44+
git add -A .
45+
git commit -m "Update zip files by ${{ github.actor }}" || echo "No changes to commit"
46+
git push

0 commit comments

Comments
 (0)