-
Notifications
You must be signed in to change notification settings - Fork 14
94 lines (82 loc) · 3.32 KB
/
starting-course.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# Code adapted from https://github.com/JetBrains/intellij-platform-plugin-template/blob/deb171483598ee8a5d7621154db880e87b4db4ef/.github/workflows/template-cleanup.yml
# by Candace Savonen for this repository.
name: Starting a new course
on:
push:
branches:
- main
workflow_dispatch:
jobs:
# Run cleaning process only if workflow is triggered by not being in the Bookdown template anymore
template-cleanup:
name: Template Cleanup
runs-on: ubuntu-latest
if: github.event.repository.name != 'DaSL_Course_Template_Bookdown'
steps:
# Check out current repository
- name: Fetch current branch
uses: actions/checkout@v2
##### Filing issues!
# Issue for what repository settings need to be set
- name: New Course - Set Repository Settings
uses: peter-evans/[email protected]
with:
title: New Course - Set Repository Settings
content-filepath: .github/automatic-issues/set-repo-settings.md
labels: automated training issue
# Issue for what needs to be edited
- name: New Course - Templates to Edit
uses: peter-evans/[email protected]
with:
title: New Course - Templates to Edit
content-filepath: .github/automatic-issues/templates-to-edit.md
labels: automated training issue
# Issue for what github secrets that need to be set
- name: New Course - Set Github Secrets
uses: peter-evans/[email protected]
with:
title: New Course - Set Github Secrets
content-filepath: .github/automatic-issues/git-secrets.md
labels: automated training issue
# Issue for how to enroll repo for updates
- name: New Course - Template Update Enrollment
uses: peter-evans/[email protected]
with:
title: New Course - Template Update Enrollment
content-filepath: .github/automatic-issues/update-enrollment.md
labels: automated training issue
##### Delete Template-specific files that aren't needed for new courses
# Cleanup Template-specific bits
- name: Cleanup
run: |
# Cleanup
rm -rf \
.github/workflows/downstream-mechanics-updates.yml \
.github/sync.yml \
.github/workflows/starting-course.yml \
.github/ISSUE_TEMPLATE/course-template-problem-report.md \
.github/ISSUE_TEMPLATE/course-template-feature-request.md \
resources/code_output \
resources/screenshots \
resources/course_screenshots \
resources/gs_slides \
resources/image_to_slide_key.tsv \
resources/images/02-chapter_of_course_files \
resources/images/03-test_cases_files \
resources/images/04-figures_files \
Course_Name.rds \
docs/*.html \
docs/*.md
# Commit modified files
- name: Commit deleted files
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git commit -m "Template cleanup"
# Push changes
- name: Push changes
uses: ad-m/github-push-action@master
with:
branch: main
github_token: ${{ secrets.GH_PAT }}