Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
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
25 changes: 25 additions & 0 deletions .github/workflows/post_to_telegram.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Notify Telegram on Push

on:
push:
branches:
- gh-pages

jobs:
notify-telegram:
runs-on: ubuntu-latest

steps:
# Step 1: Checkout the repository code
- name: Checkout code
uses: actions/checkout@v3

# Step 2: Send message to Telegram
- name: Send message to Telegram
run: |
COMMIT_MESSAGE=$(git log -1 --pretty=%B)
AUTHOR=$(git log -1 --pretty=format:'%an')
curl -s -X POST "https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendMessage" \
-d chat_id="${{ secrets.TELEGRAM_CHAT_ID }}" \
-d text="🚀 New commit pushed to *${{ github.repository }}*:\n\n*Author*: ${AUTHOR}\n*Message*: ${COMMIT_MESSAGE}\n\n🔗 [View commit](https://github.com/${{ github.repository }}/commit/${{ github.sha }})" \
-d parse_mode="Markdown"
48 changes: 47 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,49 @@
# Jekyll build artifacts
_site/
_draft/
.sass-cache/
.jekyll-cache/
.jekyll-metadata

# Posts generator directory (contains sensitive config files)
posts-generator/

# Configuration files with sensitive data
configs/
# Service account keys (extra protection)
configs/service-account.json

# Python
__pycache__/
*.py[cod]
*$py.class
*.so
.Python
env/
venv/
ENV/
env.bak/
venv.bak/

# macOS
.DS_Store
.AppleDouble
.LSOverride
.DS_Store

# Windows
Thumbs.db
ehthumbs.db
Desktop.ini

# IDE
.vscode/
.idea/
*.swp
*.swo
*~

# Logs
*.log

.specstory/
.cursorindexingignore
151 changes: 151 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
# AGENTS.md

## Project Overview

BeOps is a comprehensive documentation site covering DevOps best practices, Kubernetes, and Site Reliability Engineering (SRE) principles. The project includes:

- **Jekyll-based documentation site** with GitHub Pages hosting
- **Python content generation tools** in `posts-generator/` directory
- **AI-powered content creation** using OpenAI and Google Gemini APIs

## Setup Commands

### Jekyll Site Setup
```bash
# Install Ruby dependencies
bundle install

# Start local development server
bundle exec jekyll serve --livereload

# Build for production
bundle exec jekyll build
```

### Python Tools Setup
```bash
# Navigate to posts-generator directory
cd posts-generator

# Create virtual environment
python -m venv py-feedparser

# Activate virtual environment
source py-feedparser/bin/activate # On macOS/Linux
# or
py-feedparser\Scripts\activate # On Windows

# Install dependencies
pip install -r requirements.txt
```

## Code Style

### Python (posts-generator/)
- Follow PEP 8 style guidelines
- Use meaningful variable names
- Add docstrings for functions and classes
- Use type hints where appropriate
- Keep functions focused and single-purpose

### Jekyll/Markdown
- Use consistent front matter format
- Follow Jekyll naming conventions for posts
- Use descriptive file names with dates
- Maintain consistent heading hierarchy

## Testing Instructions

### Python Tools Testing
```bash
cd posts-generator
python py-feedparser.py --test
python title_generator.py --test
python youtube_processor.py --test
```

### Jekyll Site Testing
```bash
# Test build locally
bundle exec jekyll build

# Check for broken links
bundle exec jekyll build --verbose
```

## Content Generation Workflow

### AI Content Creation
1. **Configuration**: Use config files in `posts-generator/configs/`
2. **Prompts**: Store AI prompts in `posts-generator/prompts.json`
3. **Output**: Generated content goes to `posts-generator/produced_posts/`
4. **Logging**: Check `posts-generator/logs/` for execution logs

### Key Files
- `py-feedparser.py`: Main content generation script
- `title_generator.py`: AI-powered title generation
- `youtube_processor.py`: YouTube content processing
- `openai_worker_4o.py`: OpenAI API integration

## Security Considerations

- **API Keys**: Store in `.env` file (not in version control)
- **Service Accounts**: Use `configs/service-account.json` for Google APIs
- **Configurations**: Keep sensitive configs out of public repos

## File Structure Guidelines

### Posts
- Store in `_posts/` with format: `YYYY-MM-DD-title.md`
- Use consistent front matter
- Include proper categories and tags

### Assets
- Images go in `assets/`
- Keep file sizes optimized
- Use descriptive filenames

## Deployment

### GitHub Pages
- Site automatically builds on push to main branch
- Check GitHub Actions for build status
- Live site: https://neverthesame.github.io/BeOps/
- All authoring and content changes must be made from the `gh-pages` branch.

### Content Updates
1. Generate new content using Python tools
2. Review and edit generated content
3. Add to `_posts/` directory
4. Commit and push to trigger rebuild

## Common Tasks

### Adding New Content
```bash
cd posts-generator
python py-feedparser.py --config config-4o.json
```

### Updating Dependencies
```bash
# Python
pip freeze > requirements.txt

# Ruby
bundle update
```

### Troubleshooting
- Check logs in `posts-generator/logs/`
- Verify API configurations
- Ensure virtual environment is activated
- Check Jekyll build output for errors

## AI Integration Notes

- **OpenAI**: Use GPT-4o for content generation
- **Google Gemini**: Use for YouTube content processing
- **Prompt Management**: All prompts stored in `prompts.json`
- **Rate Limiting**: Implement proper delays between API calls
- **Error Handling**: Log all API interactions for debugging
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ source "https://rubygems.org"
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
gem "jekyll"
gem 'jekyll-feed'
gem 'jekyll-readme-index'
gem 'jemoji'
gem 'webrick'

Expand Down
97 changes: 97 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
GEM
remote: https://rubygems.org/
specs:
activesupport (6.1.7.10)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
colorator (1.1.0)
concurrent-ruby (1.3.4)
em-websocket (0.5.3)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0)
eventmachine (1.2.7)
ffi (1.17.0-arm64-darwin)
forwardable-extended (2.6.0)
gemoji (4.1.0)
google-protobuf (3.23.4-arm64-darwin)
html-pipeline (2.14.3)
activesupport (>= 2)
nokogiri (>= 1.4)
http_parser.rb (0.8.0)
i18n (1.14.6)
concurrent-ruby (~> 1.0)
jekyll (4.3.4)
addressable (~> 2.4)
colorator (~> 1.0)
em-websocket (~> 0.5)
i18n (~> 1.0)
jekyll-sass-converter (>= 2.0, < 4.0)
jekyll-watch (~> 2.0)
kramdown (~> 2.3, >= 2.3.1)
kramdown-parser-gfm (~> 1.0)
liquid (~> 4.0)
mercenary (>= 0.3.6, < 0.5)
pathutil (~> 0.9)
rouge (>= 3.0, < 5.0)
safe_yaml (~> 1.0)
terminal-table (>= 1.8, < 4.0)
webrick (~> 1.7)
jekyll-feed (0.17.0)
jekyll (>= 3.7, < 5.0)
jekyll-sass-converter (3.0.0)
sass-embedded (~> 1.54)
jekyll-watch (2.2.1)
listen (~> 3.0)
jemoji (0.13.0)
gemoji (>= 3, < 5)
html-pipeline (~> 2.2)
jekyll (>= 3.0, < 5.0)
kramdown (2.4.0)
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
liquid (4.0.4)
listen (3.9.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.4.0)
minitest (5.25.1)
nokogiri (1.13.10-arm64-darwin)
racc (~> 1.4)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (5.1.1)
racc (1.8.1)
rb-fsevent (0.11.2)
rb-inotify (0.11.1)
ffi (~> 1.0)
rexml (3.3.9)
rouge (3.30.0)
safe_yaml (1.0.5)
sass-embedded (1.58.3-arm64-darwin)
google-protobuf (~> 3.21)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.6.0)
webrick (1.9.0)
zeitwerk (2.6.18)

PLATFORMS
arm64-darwin-24
arm64-darwin-25

DEPENDENCIES
jekyll
jekyll-feed
jemoji
webrick

BUNDLED WITH
2.4.10
Loading