-
Notifications
You must be signed in to change notification settings - Fork 0
100 lines (88 loc) · 2.87 KB
/
generateCourseOverview.yml
File metadata and controls
100 lines (88 loc) · 2.87 KB
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
95
96
97
98
99
100
name: Regenerate course overview
on:
repository_dispatch:
types: [new_version]
push:
# Allows you to run this workflow manually from the Actions tab
# workflow_dispatch:
env:
EXPORTFOLDER: 'assets'
REPOSITORYFOLDER: 'repository'
jobs:
prepare:
runs-on: ubuntu-latest
steps:
- name: Check out current repository
uses: actions/checkout@v4
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token.
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.
path: repository
- name: Delete and redefine folder for exports
run: |
rm -rf ${REPOSITORYFOLDER}/${EXPORTFOLDER}
mkdir -p ${REPOSITORYFOLDER}/${EXPORTFOLDER}
- name: Cache repository
uses: actions/cache@v3
with:
path: repository
key: repository-${{ github.sha }}
run_index:
needs: prepare
runs-on: ubuntu-latest
steps:
- name: Restore repository
uses: actions/cache@v3
with:
path: repository
key: repository-${{ github.sha }}
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
# Removed npm cache that was causing failures
- name: Install LiaScript exporter
run: npm install -g @liascript/exporter
- name: Run exporter for index
run: |
cd ${REPOSITORYFOLDER}
liaex -i index.yml -o index --format project --project-category-blur
ls
- name: Commit files
run: |
cd ${REPOSITORYFOLDER}
ls
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add .
git commit -m "Add new export version of courses" || echo "No changes to commit"
- name: Push changes
uses: ad-m/github-push-action@master
with:
directory: repository
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
#commit:
# needs:
# [run_index]
# runs-on: ubuntu-latest
# steps:
# - name: Restore repository
# uses: actions/cache@v3
# with:
# path: repository
# key: repository-${{ github.sha }}
# - name: Commit files
# run: |
# cd ${REPOSITORYFOLDER}
# ls
# git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
# git config --local user.name "github-actions[bot]"
# git add .
# git commit -m "Add new export version of courses" || echo "No changes to commit"
# - name: Push changes
# uses: ad-m/github-push-action@master
# with:
# directory: repository
# github_token: ${{ secrets.GITHUB_TOKEN }}
# branch: ${{ github.ref }}