|
| 1 | +name: Regenerate course overview |
| 2 | + |
| 3 | +on: |
| 4 | + repository_dispatch: |
| 5 | + types: [new_version] |
| 6 | + push: |
| 7 | + |
| 8 | +env: |
| 9 | + EXPORTFOLDER: 'assets' |
| 10 | + REPOSITORYFOLDER: 'repository' |
| 11 | + |
| 12 | +jobs: |
| 13 | + prepare: |
| 14 | + runs-on: ubuntu-latest |
| 15 | + steps: |
| 16 | + - name: Check out current repository |
| 17 | + uses: actions/checkout@v3 |
| 18 | + with: |
| 19 | + path: repository |
| 20 | + |
| 21 | + - name: Delete and redefine folder for exports |
| 22 | + run: | |
| 23 | + rm -rf ${REPOSITORYFOLDER}/${EXPORTFOLDER} |
| 24 | + mkdir -p ${REPOSITORYFOLDER}/${EXPORTFOLDER} |
| 25 | +
|
| 26 | + - name: Cache repository |
| 27 | + uses: actions/cache@v3 |
| 28 | + with: |
| 29 | + path: repository |
| 30 | + key: repository-${{ github.sha }} |
| 31 | + |
| 32 | + run_index: |
| 33 | + needs: prepare |
| 34 | + runs-on: ubuntu-latest |
| 35 | + steps: |
| 36 | + - name: Restore repository |
| 37 | + uses: actions/cache@v3 |
| 38 | + with: |
| 39 | + path: repository |
| 40 | + key: repository-${{ github.sha }} |
| 41 | + |
| 42 | + - name: Setup Node.js |
| 43 | + uses: actions/setup-node@v3 |
| 44 | + with: |
| 45 | + node-version: '18' |
| 46 | + # Removed npm cache that was causing failures |
| 47 | + |
| 48 | + - name: Install LiaScript exporter |
| 49 | + run: npm install -g @liascript/exporter |
| 50 | + |
| 51 | + - name: Run exporter for index |
| 52 | + run: | |
| 53 | + cd ${REPOSITORYFOLDER} |
| 54 | + liaex -i index.yml -o index --format project --project-category-blur |
| 55 | +
|
| 56 | + run_prozprog: |
| 57 | + needs: prepare |
| 58 | + runs-on: ubuntu-latest |
| 59 | + steps: |
| 60 | + - name: Restore repository |
| 61 | + uses: actions/cache@v3 |
| 62 | + with: |
| 63 | + path: repository |
| 64 | + key: repository-${{ github.sha }} |
| 65 | + |
| 66 | + - name: Setup Node.js |
| 67 | + uses: actions/setup-node@v3 |
| 68 | + with: |
| 69 | + node-version: '18' |
| 70 | + # Removed npm cache that was causing failures |
| 71 | + |
| 72 | + - name: Install LiaScript exporter |
| 73 | + run: npm install -g @liascript/exporter |
| 74 | + |
| 75 | + - name: Run exporter for prozprog |
| 76 | + run: | |
| 77 | + cd ${REPOSITORYFOLDER} |
| 78 | + liaex -i prozprog.yml -o prozprog --format project --project-generate-cache --project-generate-pdf --project-generate-scorm2004 --scorm-organization "TU-Bergakademie Freiberg" --scorm-embed --scorm-masteryScore 80 --project-category-blur |
| 79 | +
|
| 80 | + run_softwareentwicklung: |
| 81 | + needs: prepare |
| 82 | + runs-on: ubuntu-latest |
| 83 | + steps: |
| 84 | + - name: Restore repository |
| 85 | + uses: actions/cache@v3 |
| 86 | + with: |
| 87 | + path: repository |
| 88 | + key: repository-${{ github.sha }} |
| 89 | + |
| 90 | + - name: Setup Node.js |
| 91 | + uses: actions/setup-node@v3 |
| 92 | + with: |
| 93 | + node-version: '18' |
| 94 | + # Removed npm cache that was causing failures |
| 95 | + |
| 96 | + - name: Install LiaScript exporter |
| 97 | + run: npm install -g @liascript/exporter |
| 98 | + |
| 99 | + - name: Run exporter for softwareentwicklung |
| 100 | + run: | |
| 101 | + cd ${REPOSITORYFOLDER} |
| 102 | + liaex -i softwareentwicklung.yml -o softwareentwicklung --format project --project-generate-cache --project-generate-pdf --project-generate-scorm2004 --scorm-organization "TU-Bergakademie Freiberg" --scorm-embed --scorm-masteryScore 80 --project-category-blur |
| 103 | +
|
| 104 | + run_robotikprojekt: |
| 105 | + needs: prepare |
| 106 | + runs-on: ubuntu-latest |
| 107 | + steps: |
| 108 | + - name: Restore repository |
| 109 | + uses: actions/cache@v3 |
| 110 | + with: |
| 111 | + path: repository |
| 112 | + key: repository-${{ github.sha }} |
| 113 | + |
| 114 | + - name: Setup Node.js |
| 115 | + uses: actions/setup-node@v3 |
| 116 | + with: |
| 117 | + node-version: '18' |
| 118 | + # Removed npm cache that was causing failures |
| 119 | + |
| 120 | + - name: Install LiaScript exporter |
| 121 | + run: npm install -g @liascript/exporter |
| 122 | + |
| 123 | + - name: Run exporter for robotikprojekt |
| 124 | + run: | |
| 125 | + cd ${REPOSITORYFOLDER} |
| 126 | + liaex -i robotikprojekt.yml -o robotikprojekt --format project --project-generate-cache --project-generate-pdf --project-generate-scorm2004 --scorm-organization "TU-Bergakademie Freiberg" --scorm-embed --scorm-masteryScore 80 --project-category-blur |
| 127 | +
|
| 128 | + run_digitalesysteme: |
| 129 | + needs: prepare |
| 130 | + runs-on: ubuntu-latest |
| 131 | + steps: |
| 132 | + - name: Restore repository |
| 133 | + uses: actions/cache@v3 |
| 134 | + with: |
| 135 | + path: repository |
| 136 | + key: repository-${{ github.sha }} |
| 137 | + |
| 138 | + - name: Setup Node.js |
| 139 | + uses: actions/setup-node@v3 |
| 140 | + with: |
| 141 | + node-version: '18' |
| 142 | + # Removed npm cache that was causing failures |
| 143 | + |
| 144 | + - name: Install LiaScript exporter |
| 145 | + run: npm install -g @liascript/exporter |
| 146 | + |
| 147 | + - name: Run exporter for digitalesysteme |
| 148 | + run: | |
| 149 | + cd ${REPOSITORYFOLDER} |
| 150 | + liaex -i digitalesysteme.yml -o digitalesysteme --format project --project-generate-cache --project-generate-pdf --project-generate-scorm2004 --scorm-organization "TU-Bergakademie Freiberg" --scorm-embed --scorm-masteryScore 80 --project-category-blur |
| 151 | +
|
| 152 | + commit_changes: |
| 153 | + needs: |
| 154 | + [ |
| 155 | + run_index, |
| 156 | + run_prozprog, |
| 157 | + run_softwareentwicklung, |
| 158 | + run_robotikprojekt, |
| 159 | + run_digitalesysteme, |
| 160 | + ] |
| 161 | + runs-on: ubuntu-latest |
| 162 | + steps: |
| 163 | + - name: Restore repository |
| 164 | + uses: actions/cache@v3 |
| 165 | + with: |
| 166 | + path: repository |
| 167 | + key: repository-${{ github.sha }} |
| 168 | + |
| 169 | + - name: Commit and push changes |
| 170 | + run: | |
| 171 | + cd ${REPOSITORYFOLDER} |
| 172 | + git config --local user.email "action@github.com" |
| 173 | + git config --local user.name "GitHub Action" |
| 174 | + git add . |
| 175 | + git commit -m "Add new export version of courses" || echo "No changes to commit" |
| 176 | + git push origin HEAD:${GITHUB_REF#refs/heads/} |
| 177 | + env: |
| 178 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments