Added non-stadga changes from 2024-05-03 meeting (#109) #23
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
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@v2 | |
with: | |
path: site | |
package-manager: pnpm@latest # Should probably be gotten from dokument-site repo instead. | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |