Update serve-ximera.yml #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Ximera Workflow | |
| on: | |
| push: | |
| 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 | |
| **/*.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_NAME: ${{ vars.XIMERA_NAME }}${{ github.ref_name }} | |
| run: | | |
| ls -alrt | |
| # git config --global --add safe.directory "$(pwd)" | |
| # export COMMAND=./xmScripts/xmlatex.test | |
| ./xmScripts/xmlatex ghaction calculus1.tex || echo NOK | |
| # ./xmScripts/xmlatex ghaction --compile draft.html || echo NOK | |
| 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: | | |
| ./xmScripts/xmlatex name | |
| # ./xmScripts/xmlatex serve -f --compile draft.html # NOTE: -f should not be needed ... | |
| ./xmScripts/xmlatex serve calculus1.tex -f # NOTE: -f should not be needed ... | |
| echo "✅ Published to $XIMERA_URL$XIMERA_NAME " >> $GITHUB_STEP_SUMMARY | |