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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
79 changes: 79 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Deploy Astro site to GitHub Pages

on:
push:
branches: ["master", "main"]
workflow_dispatch:

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

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

env:
BUILD_PATH: "."

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Detect package manager
id: detect-package-manager
run: |
if [ -f "${{ github.workspace }}/yarn.lock" ]; then
echo "manager=yarn" >> $GITHUB_OUTPUT
echo "command=install" >> $GITHUB_OUTPUT
echo "runner=yarn" >> $GITHUB_OUTPUT
echo "lockfile=yarn.lock" >> $GITHUB_OUTPUT
exit 0
elif [ -f "${{ github.workspace }}/package.json" ]; then
echo "manager=npm" >> $GITHUB_OUTPUT
echo "command=ci" >> $GITHUB_OUTPUT
echo "runner=npx --no-install" >> $GITHUB_OUTPUT
echo "lockfile=package-lock.json" >> $GITHUB_OUTPUT
exit 0
else
echo "Unable to determine package manager"
exit 1
fi
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20"
cache: ${{ steps.detect-package-manager.outputs.manager }}
cache-dependency-path: ${{ env.BUILD_PATH }}/${{ steps.detect-package-manager.outputs.lockfile }}
- name: Setup Pages
id: pages
uses: actions/configure-pages@v5
- name: Install dependencies
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
working-directory: ${{ env.BUILD_PATH }}
- name: Build with Astro
run: |
${{ steps.detect-package-manager.outputs.runner }} astro build \
--site "${{ steps.pages.outputs.origin }}" \
--base "${{ steps.pages.outputs.base_path }}"
working-directory: ${{ env.BUILD_PATH }}
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ${{ env.BUILD_PATH }}/dist

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
name: Deploy
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# build output
dist/
# generated types
.astro/

# dependencies
node_modules/

# logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*


# environment variables
.env
.env.production

# macOS-specific files
.DS_Store

# jetbrains setting folder
.idea/
40 changes: 40 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Handshake Website

This is the repository for [handshake.org](https://handshake.org), the experimental peer-to-peer root naming system.

## Architecture

This site is built using [Astro](https://astro.build/) and styled with [Tailwind CSS](https://tailwindcss.com/). It has been migrated from a legacy static HTML architecture to a modern component-based static site generator (SSG) approach.

### Key Changes
- **Modern Redesign**: The site features a clean, non-crypto aesthetic focused on its identity as an "alternate root zone for the open internet".
- **Component Based**: Headers, footers, and layouts are abstracted into reusable Astro components.
- **GitHub Pages CI/CD**: Automatic deployments are handled via GitHub Actions upon pushing to the `main` or `master` branch.

## Development Setup

1. **Prerequisites**: Ensure you have Node.js 20+ installed.
2. **Install Dependencies**:
```bash
npm install
```
3. **Start Development Server**:
```bash
npm run dev
```
Open `http://localhost:4321` in your browser.

4. **Build for Production**:
```bash
npm run build
```
The built static files will be located in the `dist/` directory.

## Deployment

The site is automatically built and deployed to GitHub Pages using the `.github/workflows/deploy.yml` GitHub Action.
Ensure that the repository settings have GitHub Pages enabled and configured to build from GitHub Actions.

## Contributing

Pull requests are welcome! If adding a new page, please utilize the `src/layouts/Layout.astro` component to ensure design consistency.
21 changes: 21 additions & 0 deletions astro.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// @ts-check
import { defineConfig } from 'astro/config';

import tailwind from '@astrojs/tailwind';

import sitemap from '@astrojs/sitemap';

// https://astro.build/config
export default defineConfig({
site: 'https://handshake.org',
integrations: [tailwind(), sitemap({
filter: (page) => page !== 'https://handshake.org/skill.md' && page !== 'https://handshake.org/llms.txt'
})],
redirects: {
'/claim.html': '/claim',
'/faq.html': '/faq',
'/community.html': '/community',
'/grant-sponsors.html': '/grant-sponsors',
'/how-it-works.html': '/how-it-works'
}
});
Loading