Skip to content

docs: update SCM files with project information #35

docs: update SCM files with project information

docs: update SCM files with project information #35

Workflow file for this run

# SPDX-License-Identifier: PMPL-1.0-or-later
name: GitHub Pages
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4
- name: Checkout casket-ssg
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4
with:
repository: hyperpolymath/casket-ssg
path: .casket-ssg
- name: Setup GHCup
uses: haskell-actions/setup@f9150cb1d140e9a9271700670baa38991e6fa25c # v2
with:
ghc-version: '9.8.2'
cabal-version: '3.10'
- name: Cache Cabal
uses: actions/cache@8b402f58fbc84540c8b491a91e594a4576fec3d7 # v4
with:
path: |
~/.cabal/packages
~/.cabal/store
.casket-ssg/dist-newstyle
key: ${{ runner.os }}-casket-${{ hashFiles('.casket-ssg/casket-ssg.cabal') }}
- name: Build casket-ssg
working-directory: .casket-ssg
run: cabal build
- name: Build site
run: |
mkdir -p site _site
# Generate index.md from README if site/index.md doesn't exist
if [ ! -f site/index.md ]; then
if [ -f README.adoc ]; then
# Convert AsciiDoc to Markdown (basic conversion)
echo "---" > site/index.md
echo "title: $(basename $PWD)" >> site/index.md
echo "date: $(date +%Y-%m-%d)" >> site/index.md
echo "---" >> site/index.md
cat README.adoc >> site/index.md
elif [ -f README.md ]; then
echo "---" > site/index.md
echo "title: $(basename $PWD)" >> site/index.md
echo "date: $(date +%Y-%m-%d)" >> site/index.md
echo "---" >> site/index.md
cat README.md >> site/index.md
else
echo "---" > site/index.md
echo "title: $(basename $PWD)" >> site/index.md
echo "date: $(date +%Y-%m-%d)" >> site/index.md
echo "---" >> site/index.md
echo "" >> site/index.md
echo "# $(basename $PWD)" >> site/index.md
echo "" >> site/index.md
echo "Documentation coming soon." >> site/index.md
fi
fi
cd .casket-ssg && cabal run casket-ssg -- build ../site ../_site
- name: Setup Pages
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5
- name: Upload artifact
uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v3
with:
path: '_site'
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4