-
Notifications
You must be signed in to change notification settings - Fork 14
64 lines (58 loc) · 1.88 KB
/
semester-upkeep.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: "Semester Setup"
on:
pull_request:
branch:
- master
# paths:
# - "**/*.ipynb"
# - "**/*.py"
schedule:
- cron: "* 16 * * *" # Spring semester
- cron: "* 4 * * *" # Fall semester
jobs:
update-semester:
runs-on: ubuntu-latest
env:
GROUP: "core"
steps:
# Checkout repositories
- name: "${GROUP}: Checkout latest master branch"
uses: actions/checkout@v2
with:
repository: "ucfai/${GROUP}"
path: "${GROUP}"
- name: "ucfai.org: Checkout latest master branch"
uses: actions/checkout@v2
with:
repository: "ucfai/ucfai.org"
path: ucfai.org
# Pull and run autobot within container
- name: "Pull autobot/production:latest"
run: docker pull docker.pkg.github.com/ucfai/bot/production:latest
- name: "Setup semester"
docker run \
-v ${GROUP}:/ucfai/${GROUP} \
-v ucfai.org:/ucfai.org \
core semester-update --all
# Push updates to ${GROUP}
- name: "Commit updates on ${GROUP}"
run: |
cd ${WORKSPACE}/${GROUP}
git config --local user.email "action@github.com"
git config --local user.name "GitHub Actions"
git commit -m "update emester" -a
- name: "Push changes to ${GROUP}"
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# Push updates to ucfai.org
- name: "Commit updates on ucfai.org"
run: |
cd ${WORKSPACE}/ucfai.org
git config --local user.email "action@github.com"
git config --local user.name "GitHub Actions"
git commit -m "add semester to website" -a
- name: "Push changes to ${GROUP}"
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}