-
Notifications
You must be signed in to change notification settings - Fork 458
103 lines (85 loc) · 2.83 KB
/
Copy pathserve-ximera.yml
File metadata and controls
103 lines (85 loc) · 2.83 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: Ximera Workflow
on:
push:
env:
XM_COMPILE_SEQUENCE: html
# XM_TO_PROCESS: "testxourse.tex calculus1.tex calculus2.tex calculus3.tex calculusA2.tex calculusE.tex calculus1TextbookBySection" # [a-z]*/exercises/exerciseList.tex"
XM_TO_PROCESS: "."
jobs:
build-ximera:
name: Build and preview Ximera Courses
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # full
- name: Setup cache
uses: actions/cache@v4
with:
path: |
**/*.html
**/*.pdf
**/*.svg
**/*.aux
**/*.xref
**/*.toc
!xmPictures/**
!.git/**
!.github/**
key: ximera-${{ github.ref_name }}-${{ github.sha }}
restore-keys: |
ximera-${{ github.ref_name }}-
ximera-
- name: Build and publish Ximera courses
env:
GPG_KEY: ${{ secrets.GPG_KEY }}
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
# XIMERA_URL: ${{ vars.XIMERA_URL }}
XIMERA_URL: "https://xerxes.ximera.org/"
# XIMERA_NAME: ${{ vars.XIMERA_NAME }}${{ github.ref_name }}
XIMERA_NAME: "calculus*preview"
XM_JOBS: 5
run: |
ls -alrt
./xmScripts/xmlatex ghaction -j 5 $XM_TO_PROCESS -f -s --compile html || echo NOK
git log --oneline --graph --decorate --all -n 10
echo "✅ Published to $XIMERA_URL$XIMERA_NAME " >> $GITHUB_STEP_SUMMARY
- name: Setup ximera serve cache (only .git)
id: serve-cache
uses: actions/cache/save@v4
with:
path: |
xmScripts/**
.git/**
key: ximeraSERVE-${{ github.ref_name }}-${{ github.sha }}
publish-ximera:
name: Publish Ximera Courses
needs: build-ximera # Waits for the build job to complete
runs-on: ubuntu-latest
environment: production
steps:
- name: Restore ximera serve cache (only .git)
id: serve-cache-restore
uses: actions/cache/restore@v4
with:
fail-on-cache-miss: true
path: |
xmScripts/**
.git/**
key: ximeraSERVE-${{ github.ref_name }}-${{ github.sha }}
- name: Serve
env:
GPG_KEY: ${{ secrets.GPG_KEY }}
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
XIMERA_URL: ${{ vars.XIMERA_URL }}
XIMERA_NAME: ${{ vars.XIMERA_NAME }}
run: |
git log --oneline --graph --decorate --all -n 10
./xmScripts/xmlatex name
./xmScripts/xmlatex serve -t $XM_TO_PROCESS
echo "✅ Published to $XIMERA_URL$XIMERA_NAME " >> $GITHUB_STEP_SUMMARY