@@ -22,87 +22,13 @@ jobs:
2222 - name : Checkout
2323 uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
2424
25- - name : Checkout casket-ssg
26- uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
27- with :
28- repository : hyperpolymath/casket-ssg
29- path : .casket-ssg
30-
31- - name : Setup GHCup
32- uses : haskell-actions/setup@ec49483bfc012387b227434aba94f59a6ecd0900 # v2
33- with :
34- ghc-version : ' 9.8.2'
35- cabal-version : ' 3.10'
36-
37- - name : Cache Cabal
38- uses : actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
39- with :
40- path : |
41- ~/.cabal/packages
42- ~/.cabal/store
43- .casket-ssg/dist-newstyle
44- key : ${{ runner.os }}-casket-${{ hashFiles('.casket-ssg/casket-ssg.cabal') }}
45-
46- - name : Build casket-ssg
47- working-directory : .casket-ssg
48- run : cabal build
49-
50- - name : Prepare site source
51- shell : bash
52- run : |
53- set -euo pipefail
54- rm -rf .site-src _site
55-
56- if [ -d site ]; then
57- cp -R site .site-src
58- else
59- mkdir -p .site-src
60- TODAY="$(date +%Y-%m-%d)"
61- REPO_NAME="${{ github.event.repository.name }}"
62- REPO_URL="https://github.com/${{ github.repository }}"
63- README_URL=""
64-
65- if [ -f README.md ]; then
66- README_URL="${REPO_URL}/blob/${{ github.ref_name }}/README.md"
67- elif [ -f README.adoc ]; then
68- README_URL="${REPO_URL}/blob/${{ github.ref_name }}/README.adoc"
69- fi
70-
71- {
72- echo "---"
73- echo "title: ${REPO_NAME}"
74- echo "date: ${TODAY}"
75- echo "---"
76- echo
77- echo "# ${REPO_NAME}"
78- echo
79- echo "Static documentation site for ${REPO_NAME}."
80- echo
81- echo "- Source repository: [${{ github.repository }}](${REPO_URL})"
82- if [ -n "${README_URL}" ]; then
83- echo "- README: [project README](${README_URL})"
84- fi
85- if [ -d docs ]; then
86- echo "- Docs directory: [docs/](${REPO_URL}/tree/${{ github.ref_name }}/docs)"
87- fi
88- echo
89- echo "Project-specific site content can be added later under site/."
90- } > .site-src/index.md
91- fi
92-
93- - name : Build site
94- run : |
95- mkdir -p _site
96- cd .casket-ssg && cabal run casket-ssg -- build ../.site-src ../_site
97- touch ../_site/.nojekyll
98-
9925 - name : Setup Pages
10026 uses : actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5
10127
10228 - name : Upload artifact
10329 uses : actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3
10430 with :
105- path : ' _site '
31+ path : ' . '
10632
10733 deploy :
10834 environment :
0 commit comments