Skip to content

Commit

Permalink
feat: initial stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
kreatoo committed Jan 4, 2025
1 parent 3553fd3 commit cf437d5
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 88 deletions.
83 changes: 62 additions & 21 deletions .github/workflows/pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,23 @@ name: Deploy Hugo site to Pages
on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]
branches: ["master"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
schedule:
- cron: '0 0 */2 * *'

# 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.
# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: false
cancel-in-progress: true

# Default to bash
defaults:
Expand All @@ -28,38 +29,78 @@ defaults:

jobs:
# Build job
build:
publish:
runs-on: ubuntu-latest
env:
HUGO_VERSION: 0.132.2
steps:
NIM_VERSION: 2.0.8
steps:
- name: Install Nim
run: |
sudo apt update
sudo apt install build-essential -y
wget -O nim.tar.xz "https://nim-lang.org/download/nim-$NIM_VERSION-linux_x64.tar.xz"
tar -xvf nim.tar.xz
cd "nim-$NIM_VERSION"
sudo mkdir -p "/usr/include" "/usr/bin" "/etc/nim" "/usr/lib/nim"
sudo cp -r lib/ "/usr/lib/nim"
sudo cp -r compiler/ "/usr/lib/nim"
sudo cp -rf config/* -t "/etc/nim"
sudo cp -rf bin/* -t "/usr/bin"
sudo cp -rf "/usr/lib/nim/"*.h "/usr/include" || true
cd ..
rm -rf nim-*
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@main
with:
fetch-depth: 0 # fetch all history for .GitInfo and .Lastmod
submodules: recursive
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Setup Pages
id: pages
uses: actions/configure-pages@v4
- name: Setup Hugo

- name: Build genpkglist
run: |
git clone https://github.com/kreatolinux/src
cd src
nimble install cligen fusion -y
make genpkglist
sudo mv out/genpkglist /bin
cd ..
- name: Add manpages to documentation
run: |
cd src
for i in man/*.md; do
genpkglist generateManpage --file="$i" --output="$GITHUB_WORKSPACE/content/docs/manpages/$(basename $i)"
done
cd ..
rm -rf src
- name: Install Hugo CLI
run: |
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
- name: Setup Pages
id: pages
uses: actions/configure-pages@main

- name: Generate packages directory
run: |
git clone https://github.com/kreatolinux/kpkg-repo
mkdir "$GITHUB_WORKSPACE/content/packages"
genpkglist generate --all --pkgPath=kpkg-repo --output="$GITHUB_WORKSPACE/content/packages" -v
rm -rf kpkg-repo
- name: Build with Hugo
env:
# For maximum backward compatibility with Hugo modules
HUGO_ENVIRONMENT: production
HUGO_ENV: production
run: |
hugo \
--gc --minify \
--baseURL "${{ steps.pages.outputs.base_url }}/"
--minify
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
uses: actions/upload-pages-artifact@main
with:
path: ./public

Expand All @@ -69,8 +110,8 @@ jobs:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
needs: publish
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
uses: actions/deploy-pages@main
17 changes: 0 additions & 17 deletions content/_index.md

This file was deleted.

6 changes: 0 additions & 6 deletions content/about.md

This file was deleted.

18 changes: 0 additions & 18 deletions content/docs/_index.md

This file was deleted.

9 changes: 0 additions & 9 deletions content/docs/first-page.md

This file was deleted.

10 changes: 0 additions & 10 deletions content/docs/folder/_index.md

This file was deleted.

7 changes: 0 additions & 7 deletions content/docs/folder/leaf.md

This file was deleted.

0 comments on commit cf437d5

Please sign in to comment.