https://github.com/emasuriano/ollama-ci-demo
Demo of using Ollama + CI
https://github.com/emasuriano/ollama-ci-demo
automation daily demo github-actions ollama
Last synced: 25 days ago
JSON representation
Demo of using Ollama + CI
- Host: GitHub
- URL: https://github.com/emasuriano/ollama-ci-demo
- Owner: EmaSuriano
- Created: 2025-03-26T09:36:01.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2025-04-02T17:51:56.000Z (26 days ago)
- Last Synced: 2025-04-02T18:48:27.155Z (26 days ago)
- Topics: automation, daily, demo, github-actions, ollama
- Language: Astro
- Homepage: https://emasuriano.github.io/ollama-ci-demo/
- Size: 195 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Daily Motivation with Ollama CI Demo
This repository demonstrates how to integrate [Ollama](https://ollama.com/) into GitHub Actions to automatically generate and publish daily motivational phrases to an Astro website.
## 🌟 Project Overview
Every day at midnight UTC, this project:
1. Uses GitHub Actions to run Ollama with the Llama3.2 model
2. Generates a new inspirational phrase
3. Saves it to the repository
4. Builds and deploys an updated Astro website showcasing all phrasesVisit the [live demo site](https://emasuriano.github.io/ollama-ci-demo) to see today's motivational phrase.
| Dark | Light |
| ---------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
|  |  |## ⚙️ How It Works
### GitHub Actions Workflow
The entire process is orchestrated through GitHub Actions, making it fully automated:
```yml
name: deployon:
push:
branches: [main]
workflow_dispatch:
schedule:
- cron: "0 0 * * *" # Runs every day at midnight UTCjobs:
ollama:
# First job: Generate today's phrase with Ollama
# ...build:
# Second job: Build the Astro site
# ...deploy:
# Third job: Deploy to GitHub Pages
# ...
```
### The Process in Detail
1. **Phrase Generation Job** (`ollama`):
- Installs Ollama on the GitHub Actions runner
- Runs the Llama3.2 model with the prompt "Give me an inspirational phrase"
- Saves the output to a Markdown file with the current date
- Commits the new file to the repository2. **Build Job** (`build`):
- Runs after the ollama job completes successfully
- Checks out the updated repository
- Builds the Astro site with all phrases3. **Deploy Job** (`deploy`):
- Runs after the build job completes
- Deploys the built site to GitHub Pages## 🚀 Features
- **Fully Automated**: No manual intervention needed
- **Daily Updates**: Fresh content every day
- **Simple Architecture**: Demonstrates CI/CD principles with minimal complexity
- **Fast Deployment**: From generation to live in minutes## 🛠️ Tech Stack
- [Ollama](https://ollama.com/) - For running Llama3.2 locally in CI environment
- [Astro](https://astro.build/) - Fast, lightweight web framework
- [TailwindCSS](https://tailwindcss.com/) - For styling
- [GitHub Actions](https://github.com/features/actions) - For CI/CD automation
- [GitHub Pages](https://pages.github.com/) - For hosting## 📁 Project Structure
```
├── .github/workflows # GitHub Actions configuration
│ └── deploy.yml # Main workflow file
├── src
│ ├── components # Astro components
│ ├── layouts # Page layouts
│ ├── pages # Website routes
│ ├── phrases # Generated motivational phrases
│ │ └── YYYY-MM-DD.md # One file per day
│ ├── styles # CSS files
│ └── utils # Helper functions
├── public # Static assets
├── astro.config.mjs # Astro configuration
└── package.json # Dependencies
```## 🔄 How the Workflow Runs
1. **Scheduled Trigger**: At midnight UTC every day
2. **Manual Trigger**: On push to main branch or manual dispatch
3. **Sequential Jobs**: Each job waits for the previous one to complete
4. **Permissions Control**: Minimal permissions for security## 🧩 Extending the Demo
You can adapt this pattern for various use cases:
- Generate blog post ideas
- Create daily statistics or reports
- Update documentation based on code changes
- Produce daily artwork or visualizations## 📚 Getting Started
To run this project locally:
1. Clone the repository
2. Install dependencies with `npm install`
3. Run the development server with `npm run dev`To set up your own version:
1. Fork this repository
2. Update the `astro.config.mjs` with your GitHub username
3. Enable GitHub Pages in your repository settings
4. Ensure GitHub Actions permissions are configured correctly## 🤝 Contributing
Contributions are welcome! Feel free to open issues or submit pull requests.
## 📝 License
MIT
---
Made with ❤️ and O