No need to install tetex on pre-created image. #98
This file contains 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
# Simple workflow for deploying static content to GitHub Pages | |
name: Deploy static content to Pages | |
on: | |
# Runs on pushes targeting the default branch | |
push: | |
branches: ["main"] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
permissions: | |
contents: write # If generate workload would not perform a 'release' by default, the read permission would be sufficient. | |
pages: write | |
id-token: write | |
# Allow one concurrent deployment | |
concurrency: | |
group: "pages" | |
cancel-in-progress: true | |
jobs: | |
generate: | |
uses: ./.github/workflows/generate.yml | |
with: | |
html: true | |
epub: true | |
pdf: true | |
release: false | |
# Single deploy job since we're just deploying | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
needs: generate | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Pages | |
uses: actions/configure-pages@v2 | |
- name: Download generated songbook artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: songbooks | |
path: _generated | |
- name: Prepare _site | |
run: | | |
unzip -o _generated/*.zip -d _site/ | |
mv _generated/*.pdf _site/ | |
mv _generated/*.epub _site/ | |
cp -R editor _site/ | |
ls -la _site/ | |
export REPL=$(cd _site; ls *.epub *.pdf | sed 's|\(.*a4.pdf\)|<span><a href="./../\1">PDF (A4)</a></span>|' | sed 's|\(.*a5.pdf\)|<span><a href="./../\1">PDF (A5)</a></span>|' | sed 's|\(.*epub\)|<span><a href="./../\1">EPUB</a></span>|') | |
python3 -c 'import sys; import os; print(sys.stdin.read().replace("<!--INJECT HERE-->", "Całość: " + os.getenv("REPL")))' <_site/songs_html/index.xhtml >_site/songs_html/.index.xhtml | |
mv _site/songs_html/.index.xhtml _site/songs_html/index.xhtml | |
- name: Upload artifact for pages | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
# Upload entire repository | |
path: '_site' | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v1 |