Skip to content

Merge pull request #95 from Supergamer1337/auto-build #1

Merge pull request #95 from Supergamer1337/auto-build

Merge pull request #95 from Supergamer1337/auto-build #1

Workflow file for this run

name: Deploy .pdfs to GitHub Pages
on:
push:
branches:
- master
# 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: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: 'pages'
cancel-in-progress: false
jobs:
build:
uses: ./.github/workflows/build_all.yml
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Get pdfs
uses: actions/download-artifact@v3
with:
path: ./pdfs
- name: Flatten directory structure and remove empty directories
run: |
find ./pdfs -mindepth 2 -type f -print -exec mv {} ./pdfs \;
find ./pdfs -type d -empty -delete
- name: Create pdf index
run: |
echo "$(cat upper_template.html)" > pdfs/index.html
cd pdfs
for f in *.pdf; do
echo "<a href=\"$f\"><li>$f</li></a>" >> index.html
done
echo "</ul></body></html>" >> index.html
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: './pdfs'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2