Skip to content

Updates from SM 2024-02-22 (#105) #16

Updates from SM 2024-02-22 (#105)

Updates from SM 2024-02-22 (#105) #16

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: Clean all files and folders except .pdfs
run: |
find . -not -path "./pdfs/*" -not -name "pdfs" -not -name "." -delete
- name: Checkout site repository
uses: actions/checkout@v3
with:
repository: cthit/dokument-site
path: site
- name: Move .pdfs to public folder
run: |
mkdir site/public
mv pdfs/* site/public/
rm -rf pdfs
- name: Install, build and upload site output
uses: withastro/action@v0
with:
path: site
package-manager: pnpm
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2