Compare commits

...

10 commits

Author SHA1 Message Date
Decobus
84d9093750 Merge pull request 'Add Forgejo Actions and documentation' (#1) from feature/add-github-actions into main
Some checks failed
Deploy to S3 / deploy (push) Failing after 3m8s
Reviewed-on: #1
2025-07-17 21:38:10 +03:00
Derek Slenk
b660b9cd5d Downgrade upload-artifact to v3 for GHES compatibility
All checks were successful
Build Site / build (pull_request) Successful in 1m3s
actions/upload-artifact@v4 is not supported on GHES/Forgejo Actions. Using v3 for compatibility.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-17 14:36:25 -04:00
Derek Slenk
0f6983565a Use correct action references for Forgejo Actions
Some checks failed
Build Site / build (pull_request) Failing after 1m9s
Forgejo has actions/checkout, actions/upload-artifact, and aws-actions/configure-aws-credentials in its data repository. Only peaceiris/actions-hugo needs the full GitHub URL.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-17 14:34:36 -04:00
Derek Slenk
c0d5b498ea Fix Forgejo Actions to use GitHub action references
Some checks failed
Build Site / build (pull_request) Has been cancelled
Forgejo Actions doesn't have all GitHub Actions in its data repository, so we need to reference the full GitHub URLs for actions like peaceiris/actions-hugo and aws-actions/configure-aws-credentials.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-17 14:33:58 -04:00
Derek Slenk
adeb2efd1e Remove GitHub Actions workflows in favor of Forgejo Actions
Some checks failed
Build Site / build (pull_request) Failing after 8s
GitHub Actions workflows are no longer needed since we're using Forgejo Actions for CI/CD on the self-hosted runner.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-17 14:31:17 -04:00
Derek Slenk
a837049a4f Add CLAUDE.md documentation for future Claude Code instances
Includes project overview, development commands, architecture details, and tea CLI commands for Forgejo integration.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-17 14:30:30 -04:00
Derek Slenk
9dbd1af5f9 Add Forgejo Actions workflows for Hugo site
- Add build workflow for PR validation
- Add deploy workflow for main branch S3 deployment
- Use self-hosted runners

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-17 14:20:51 -04:00
Derek Slenk
0265c44006
Update .github/workflows/build.yml
Some checks failed
Build Site / build (push) Has been cancelled
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-06-29 22:37:52 -04:00
Derek Slenk
5a325d0273
disable cloudfront deploy for now 2025-06-29 22:36:31 -04:00
Derek Slenk
21ce49b769 Add GitHub Actions workflows for build and deployment
- Add build.yml: builds Hugo site on all non-main branches and PRs
- Add deploy.yml: builds and deploys to S3 + CloudFront on main branch pushes
- Uses generic OIDC role for AWS authentication
2025-06-29 22:35:02 -04:00
3 changed files with 144 additions and 0 deletions

View file

@ -0,0 +1,33 @@
name: Build Site
on:
pull_request:
branches:
- main
jobs:
build:
runs-on: self-hosted
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Setup Hugo
uses: https://github.com/peaceiris/actions-hugo@v3
with:
hugo-version: 'latest'
extended: true
- name: Build Hugo site
run: hugo --minify
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: hugo-build
path: public/
retention-days: 7

View file

@ -0,0 +1,37 @@
name: Deploy to S3
on:
push:
branches:
- main
jobs:
deploy:
runs-on: self-hosted
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Setup Hugo
uses: https://github.com/peaceiris/actions-hugo@v3
with:
hugo-version: 'latest'
extended: true
- name: Build Hugo site
run: hugo --minify
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Deploy to S3
run: |
aws s3 sync public/ s3://${{ secrets.S3_BUCKET_NAME }} --delete --no-cli-pager

74
CLAUDE.md Normal file
View file

@ -0,0 +1,74 @@
# CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
## Project Overview
This is a Hugo static site generator project for "The Angry Michigander" blog. The site uses the Lynx theme (github.com/jpanther/lynx) via Hugo modules.
## Development Commands
- **Local development**: `hugo server -D` (serves locally with drafts)
- **Build for production**: `hugo --minify` (outputs to `public/` directory)
- **Build regular**: `hugo` (outputs to `public/` directory)
## Architecture
- **Framework**: Hugo static site generator with Go modules
- **Theme**: Lynx theme (github.com/jpanther/lynx v1.4.0) imported as Hugo module
- **Configuration**: hugo.yaml (main config file)
- **Content**: Markdown files in `content/` directory
- **Static assets**: `static/` directory for static files
- **Build output**: `public/` directory (generated, not tracked in git)
## Key Files and Directories
- `hugo.yaml` - Main Hugo configuration
- `go.mod` - Go module dependencies for Hugo modules
- `content/` - Markdown content files
- `archetypes/` - Content templates (default.md, post.md)
- `layouts/partials/` - Custom layout overrides
- `static/` - Static assets
- `assets/` - Source assets (CSS, images)
## CI/CD
The project has dual CI/CD setup:
- **GitHub Actions**: `.github/workflows/` (ubuntu-latest runner)
- **Forgejo Actions**: `.forgejo/workflows/` (self-hosted runner)
Both include build and deploy workflows that:
1. Check out code with submodules
2. Set up Hugo extended version
3. Build with `hugo --minify`
4. Upload artifacts to `public/` directory
## Forgejo Integration
This project uses Forgejo for source control. Use the `tea` CLI tool (https://gitea.com/gitea/tea) for Forgejo operations instead of `gh` CLI:
- **Setup**: `tea login add` (first-time setup)
- **List pull requests**: `tea pulls` or `tea pulls list`
- **Create pull request**: `tea pulls create`
- **View pull request**: `tea pulls [PR index]`
- **Merge pull request**: `tea pulls merge [PR index]`
- **List issues**: `tea issues` or `tea issues list`
- **Create issue**: `tea issues create`
- **View issue**: `tea issues [issue index]`
Always prefer `tea` commands over `gh` commands when working with this repository's Forgejo instance.
## Theme Customization
The Lynx theme is used via Hugo modules. Custom overrides can be placed in:
- `layouts/` - Layout overrides
- `assets/css/custom.css` - Custom CSS
- `static/` - Static file overrides
## Content Creation
Use archetypes for new content:
- `archetypes/default.md` - Default content template
- `archetypes/post.md` - Blog post template with extensive frontmatter options
Create new posts with: `hugo new posts/my-post.md`