Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/actions/free-disk-space/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: "Free Disk Space"
description: "Optimize available disk space by removing pre-installed software on GitHub-hosted Linux runners."

runs:
using: "composite"
steps:
- name: Free Disk Space
if: runner.environment == 'github-hosted' && runner.os == 'Linux'
shell: bash
run: |
echo "Optimizing runner disk space..."
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
sudo rm -rf /usr/local/share/boost
sudo chown -R "$USER:$USER" "$AGENT_TOOLSDIRECTORY" 2>/dev/null || true
df -h /
55 changes: 55 additions & 0 deletions .github/actions/setup-devenv/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: "Setup Devenv"
description: "Initialize Nix and warm up the devenv shell environment."

inputs:
cachix-cache-name:
description: "Cachix cache name."
required: false
default: "devenv"
cachix-auth-token:
description: "Cachix authorization token."
required: false
default: ""
skip-push:
description: "Skip pushing build artifacts to Cachix."
required: false
default: "true"

runs:
using: "composite"
steps:
- name: Free Disk Space
uses: ./.github/actions/free-disk-space

- name: Install Nix
if: runner.environment == 'github-hosted'
uses: cachix/install-nix-action@v31
with:
nix_path: nixpkgs=channel:nixos-unstable

- name: Install Cachix
if: runner.environment == 'github-hosted'
uses: cachix/cachix-action@v15
with:
name: ${{ inputs.cachix-cache-name }}
authToken: ${{ inputs.cachix-auth-token }}
skipPush: ${{ inputs.skip-push }}

- name: Install Devenv CLI
shell: bash
run: |
if [ -d "$HOME/.nix-profile/bin" ]; then
echo "$HOME/.nix-profile/bin" >> "$GITHUB_PATH"
export PATH="$HOME/.nix-profile/bin:$PATH"
fi
if ! command -v devenv >/dev/null 2>&1; then
nix profile add --accept-flake-config nixpkgs#devenv || nix profile install --accept-flake-config tarball+https://install.devenv.sh/latest
if [ -d "$HOME/.nix-profile/bin" ]; then
echo "$HOME/.nix-profile/bin" >> "$GITHUB_PATH"
export PATH="$HOME/.nix-profile/bin:$PATH"
fi
fi

- name: Warm Up Devenv Environment
shell: bash
run: devenv --no-tui shell -- echo "devenv ready"
58 changes: 58 additions & 0 deletions .github/actions/step-summary/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: "Step Summary"
description: "Render a standardized execution summary table to GITHUB_STEP_SUMMARY."

inputs:
title:
description: "Summary table header title."
required: false
default: "Build & Test Summary"
jobs:
description: "Multiline list of pipe-delimited Step Name|outcome pairs."
required: true
footer:
description: "Optional markdown footer text."
required: false
default: ""

runs:
using: "composite"
steps:
- name: Write Step Summary
shell: bash
run: |
{
echo "## ${{ inputs.title }}"
echo ""
if [ -n "${{ github.event.pull_request.number }}" ]; then
echo "**Pull Request**: #${{ github.event.pull_request.number }} - ${{ github.event.pull_request.title }}"
echo "**Branch**: \`${{ github.head_ref }}\` → \`${{ github.base_ref }}\`"
echo ""
fi
echo "| Step | Status |"
echo "| :--- | :---: |"
while IFS='|' read -r step outcome; do
[ -z "$step" ] && continue
case "$outcome" in
success)
status="✅ Passed"
;;
failure)
status="❌ Failed"
;;
cancelled)
status="⛔ Cancelled"
;;
skipped)
status="⏭️ Skipped"
;;
*)
status="ℹ️ $outcome"
;;
esac
echo "| $step | $status |"
done <<< "${{ inputs.jobs }}"
if [ -n "${{ inputs.footer }}" ]; then
echo ""
echo "${{ inputs.footer }}"
fi
} >> "$GITHUB_STEP_SUMMARY"
72 changes: 72 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: CI

on:
push:
branches:
- trunk
pull_request:
branches:
- trunk

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

permissions:
contents: read

jobs:
verify:
name: Verify Toolchain & Build
runs-on:
group: tars-cloud
labels: [self-hosted, nixos]
steps:
- name: Checkout Source Code
id: checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Optimize Runner Disk Space
id: disk_space
uses: ./.github/actions/free-disk-space

- name: Initialize Devenv Toolchain
id: devenv_setup
uses: ./.github/actions/setup-devenv

- name: Run Devenv Test Suite
id: test
run: devenv test

- name: Validate Zola Syntax & Links
id: zola_check
run: devenv --no-tui shell -- zola check

- name: Compile Site & Generate Search Index
id: build
run: devenv --no-tui shell -- zola build && devenv --no-tui shell -- pagefind --site public

- name: Verify Routing & Crawler Directives
id: verify_assets
run: |
test -f public/CNAME
test "$(cat public/CNAME)" = "tars-cloud.ai"
test -f public/robots.txt
grep -q "https://tars-cloud.ai/sitemap.xml" public/robots.txt
test -f public/pagefind/pagefind.js

- name: Render Summary Table
if: always()
uses: ./.github/actions/step-summary
with:
title: "CI Verification Summary"
jobs: |
Checkout Source Code|${{ steps.checkout.outcome }}
Optimize Runner Disk Space|${{ steps.disk_space.outcome }}
Initialize Devenv Toolchain|${{ steps.devenv_setup.outcome }}
Run Devenv Test Suite|${{ steps.test.outcome }}
Validate Zola Syntax & Links|${{ steps.zola_check.outcome }}
Compile Site & Generate Search Index|${{ steps.build.outcome }}
Verify Routing & Crawler Directives|${{ steps.verify_assets.outcome }}
82 changes: 82 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Deploy

on:
push:
branches:
- trunk

concurrency:
group: pages-deploy
cancel-in-progress: false

permissions:
contents: read
pages: write
id-token: write

jobs:
deploy:
name: Build & Publish GitHub Pages
runs-on:
group: tars-cloud
labels: [self-hosted, nixos]
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout Source Code
id: checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Optimize Runner Disk Space
id: disk_space
uses: ./.github/actions/free-disk-space

- name: Initialize Devenv Toolchain
id: devenv_setup
uses: ./.github/actions/setup-devenv

- name: Compile Production Site & Search Index
id: build
run: devenv --no-tui shell -- zola build && devenv --no-tui shell -- pagefind --site public

- name: Verify Routing & Crawler Directives
id: verify_assets
run: |
test -f public/CNAME
test "$(cat public/CNAME)" = "tars-cloud.ai"
test -f public/robots.txt
grep -q "https://tars-cloud.ai/sitemap.xml" public/robots.txt
test -f public/pagefind/pagefind.js

- name: Configure GitHub Pages
id: pages_config
uses: actions/configure-pages@v5

- name: Upload Pages Artifact
id: upload_pages
uses: actions/upload-pages-artifact@v3
with:
path: public

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

- name: Render Summary Table
if: always()
uses: ./.github/actions/step-summary
with:
title: "Pages Deployment Summary"
jobs: |
Checkout Source Code|${{ steps.checkout.outcome }}
Optimize Runner Disk Space|${{ steps.disk_space.outcome }}
Initialize Devenv Toolchain|${{ steps.devenv_setup.outcome }}
Compile Production Site & Search Index|${{ steps.build.outcome }}
Verify Routing & Crawler Directives|${{ steps.verify_assets.outcome }}
Configure GitHub Pages|${{ steps.pages_config.outcome }}
Upload Pages Artifact|${{ steps.upload_pages.outcome }}
Deploy to GitHub Pages|${{ steps.deployment.outcome }}
footer: "🚀 Successfully published to [https://tars-cloud.ai](https://tars-cloud.ai)"
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,14 @@ devenv.local.yaml

# pre-commit
.pre-commit-config.yaml

# Build outputs
public/
.pagefind/

# Cache directories
.cache/

# Operating system files
.DS_Store
Thumbs.db
47 changes: 47 additions & 0 deletions .versionrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# .versionrc - Conventional commit configuration for convco
---
header: |
# Changelog
types:
- type: feat
section: Features
hidden: false
- type: fix
section: Fixes
hidden: false
- type: perf
section: Performance
hidden: false
- type: docs
section: Documentation
hidden: true
- type: build
section: Other
hidden: true
- type: chore
section: Other
hidden: true
- type: ci
section: Other
hidden: true
- type: style
section: Other
hidden: true
- type: refactor
section: Other
hidden: true
- type: test
section: Other
hidden: true
preMajor: false
commitUrlFormat: 'https://github.com/tars-cloud/website/commit/{{hash}}'
compareUrlFormat: 'https://github.com/tars-cloud/website/compare/{{previousTag}}...{{currentTag}}'
issueUrlFormat: 'https://github.com/tars-cloud/website/issues/{{issue}}'
releaseCommitMessageFormat: 'chore(release): {{currentTag}}'
issuePrefixes:
- '#'
scopeRegex: '[[:alnum:]]+(?:[-_/][[:alnum:]]+)*'
lineLength: 80
wrapDisabled: false
linkCompare: true
linkReferences: true
Loading
Loading