Skip to content

Commit 2b29917

Browse files
committed
Setup actions
1 parent 639bfd9 commit 2b29917

File tree

3 files changed

+98
-36
lines changed

3 files changed

+98
-36
lines changed

.github/workflows/create-release.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

.github/workflows/serve-ximera.yml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: Ximera Workflow
2+
3+
on:
4+
push:
5+
# tags:
6+
# - 'v*' # Trigger the workflow when a new tag starting with 'v' is pushed
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+
# These variables can/should be set at repository level
46+
# If not set, defaults from xmScripts/config.txt or xlatex will be used
47+
# (The defaults will presumably make this step fail.)
48+
GPG_KEY: ${{ secrets.GPG_KEY }}
49+
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
50+
XIMERA_URL: ${{ vars.XIMERA_URL }}
51+
XIMERA_NAME: ${{ vars.XIMERA_NAME }}${{ github.ref_name }}
52+
run: |
53+
ls -alrt
54+
chmod +x xmScripts/xmlatex # Overleaf sync might reset it :-()
55+
./xmScripts/xmlatex ghaction
56+
echo "✅ Published to $XIMERA_URL$XIMERA_NAME " >> $GITHUB_STEP_SUMMARY
57+
58+
- name: Setup ximera serve cache (only .git)
59+
id: serve-cache
60+
uses: actions/cache/save@v4
61+
with:
62+
path: |
63+
xmScripts/**
64+
.git/**
65+
key: ximeraSERVE-${{ github.ref_name }}-${{ github.sha }}
66+
67+
68+
publish-ximera:
69+
name: Publish Ximera Courses
70+
needs: build-ximera # Waits for the build job to complete
71+
runs-on: ubuntu-latest
72+
environment: production # Allows for 'manual review' step
73+
steps:
74+
- name: Restore ximera serve cache (only .git)
75+
id: serve-cache-restore
76+
uses: actions/cache/restore@v4
77+
with:
78+
fail-on-cache-miss: true
79+
path: |
80+
xmScripts/**
81+
.git/**
82+
key: ximeraSERVE-${{ github.ref_name }}-${{ github.sha }}
83+
84+
- name: Serve
85+
env:
86+
GPG_KEY: ${{ secrets.GPG_KEY }}
87+
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
88+
XIMERA_URL: ${{ vars.XIMERA_URL }}
89+
XIMERA_NAME: ${{ vars.XIMERA_NAME }}
90+
run: |
91+
chmod +x xmScripts/xmlatex # Overleaf sync might reset it :-()
92+
./xmScripts/xmlatex name
93+
./xmScripts/xmlatex serve -f # NOTE: -f should not be needed ...
94+
echo "✅ Published to $XIMERA_URL$XIMERA_NAME " >> $GITHUB_STEP_SUMMARY
95+
96+
97+

xmScripts/config.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# : "${XAKE_BASE:=ximeralatex}"
55
# : "${XAKE_VERSION:=v2.6.8}"
6-
# : "${XAKE_VERSION:=v2.6.8-full}" # with texlive_full
6+
: "${XAKE_VERSION:=v2.6.8-full}" # with texlive_full
77
#
88
# For publishing you'll need a GPG Key
99
# To generate a key-pair, fill in your name and email, and run 'xmlatex genKey'

0 commit comments

Comments
 (0)