Skip to content

Merge pull request #161 from ptabor/se-2024-06-30-7095-Zielony_plomie… #112

Merge pull request #161 from ptabor/se-2024-06-30-7095-Zielony_plomie…

Merge pull request #161 from ptabor/se-2024-06-30-7095-Zielony_plomie… #112

Workflow file for this run

# 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@v4
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Download generated songbook artifacts
uses: actions/download-artifact@v4
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@v3
with:
# Upload entire repository
path: '_site'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4