From 26c48a4abc458a2cd5a463040397a19fcd86f4c3 Mon Sep 17 00:00:00 2001 From: Goostaf Date: Mon, 4 Sep 2023 19:03:41 +0200 Subject: [PATCH] Use Astro for site building Co-authored-by: Felix Bjerhem Aronsson --- .github/workflows/publish.yml | 28 ++++++++++++------- README.md | 2 ++ upper_template.html | 51 ----------------------------------- 3 files changed, 20 insertions(+), 61 deletions(-) delete mode 100644 upper_template.html diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 26c4779..9deeffd 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -45,20 +45,28 @@ jobs: find ./pdfs -mindepth 2 -type f -print -exec mv {} ./pdfs \; find ./pdfs -type d -empty -delete - - name: Create pdf index + - name: Clean all files and folders except .pdfs run: | - echo "$(cat upper_template.html)" > pdfs/index.html - cd pdfs - for f in *.pdf; do - echo "
  • $f
  • " >> index.html - done - echo "" >> index.html + find . -not -path "./pdfs/*" -not -name "pdfs" -not -name "." -delete - - name: Upload artifact - uses: actions/upload-pages-artifact@v2 + - name: Checkout site repository + uses: actions/checkout@v3 with: - path: './pdfs' + 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 diff --git a/README.md b/README.md index 5b76b07..a8ef2d6 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,8 @@ Dokument tillhörande Teknologsektionen Informationsteknik på Chalmers tekniska högskola. Det inkluderar bl.a. styrdokument och riktlinjer. De publicerade dokumenten kan hittas på https://docs.chalmers.it/. Nya ändringar är publiceras automatiskt när de pushas till master-branchen. +Sidan är byggd med hjälp av [Astro](https://astro.build/), som är en statisk webbsidesgenerator. +Repot för sidan finns [här](https://github.com/cthit/dokument-site). ## Göra ändringar diff --git a/upper_template.html b/upper_template.html deleted file mode 100644 index 61f1646..0000000 --- a/upper_template.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - Document - - - -

    IT-Division Documents

    -