|
| 1 | +name: Ximera Workflow |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - 'main' |
| 7 | + |
| 8 | +jobs: |
| 9 | + build-ximera: |
| 10 | + name: Build and preview Ximera Courses |
| 11 | + runs-on: ubuntu-latest |
| 12 | + |
| 13 | + permissions: |
| 14 | + actions: read |
| 15 | + contents: read |
| 16 | + packages: write |
| 17 | + |
| 18 | + steps: |
| 19 | + - name: Checkout code |
| 20 | + uses: actions/checkout@v4 |
| 21 | + with: |
| 22 | + fetch-depth: 0 # full |
| 23 | + |
| 24 | + - name: Setup cache |
| 25 | + uses: actions/cache@v4 |
| 26 | + with: |
| 27 | + path: | |
| 28 | + **/*.html |
| 29 | + **/*.pdf |
| 30 | + **/*.svg |
| 31 | + **/*.aux |
| 32 | + **/*.xref |
| 33 | + **/*.toc |
| 34 | + !xmPictures/** |
| 35 | + !.git/** |
| 36 | + !.github/** |
| 37 | + key: ximera-${{ github.ref_name }}-${{ github.sha }} |
| 38 | + restore-keys: | |
| 39 | + ximera-${{ github.ref_name }}- |
| 40 | + ximera- |
| 41 | +
|
| 42 | +
|
| 43 | + - name: Build and publish Ximera courses |
| 44 | + env: |
| 45 | + ### Use .xmKeyfile for test/demo |
| 46 | + # GPG_KEY: ${{ secrets.GPG_KEY }} |
| 47 | + # GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }} |
| 48 | + XIMERA_URL: "https://xerxes.ximera.org/" |
| 49 | + XIMERA_NAME: ${{ github.repository_owner }}-${{ github.event.repository.name }} |
| 50 | + XM_COMPILE_SEQUENCE: "html,handout.pdf" |
| 51 | + # XIMERA_NAME: ${{ vars.XIMERA_NAME }}*${{ github.ref_name }} |
| 52 | + # XIMERA_NAME: ${{ github.repository_owner }}-${{ github.event.repository.name }}-${{ github.ref_name }} |
| 53 | + run: | |
| 54 | + ls -alrt |
| 55 | + chmod +x xmScripts/xmlatex |
| 56 | + rm -rf ximera-downloads/with-answers |
| 57 | + # git config --global http.postBuffer 524288000 |
| 58 | + # git config --global core.compression 9 |
| 59 | + ./xmScripts/xmlatex bake -j 5 |
| 60 | + ./xmScripts/xmlatex frost |
| 61 | + ./xmScripts/xmlatex name |
| 62 | + ./xmScripts/xmlatex serve |
| 63 | + # ./xmScripts/xmlatex ghaction |
| 64 | + echo "✅ Published to $XIMERA_URL$XIMERA_NAME " >> $GITHUB_STEP_SUMMARY |
| 65 | +
|
| 66 | + - name: Setup ximera serve cache (only .git) |
| 67 | + id: serve-cache |
| 68 | + uses: actions/cache/save@v4 |
| 69 | + with: |
| 70 | + path: | |
| 71 | + xmScripts/** |
| 72 | + .git/** |
| 73 | + key: ximeraSERVE-${{ github.ref_name }}-${{ github.sha }} |
| 74 | + |
0 commit comments