Skip to content

Commit 3c74a4f

Browse files
committed
new blog and workflow optimizations
1 parent d4245f1 commit 3c74a4f

24 files changed

Lines changed: 1177 additions & 40 deletions

.cursor/worktrees.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"setup-worktree": [
3+
"npm install"
4+
]
5+
}

.github/workflows/axe.yml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ jobs:
2626
steps:
2727
- name: Checkout 🛎️
2828
uses: actions/checkout@v4
29-
- name: Setup Ruby
30-
uses: ruby/setup-ruby@v1
29+
- name: Install pixi 🦊
30+
uses: prefix-dev/setup-pixi@v0.10.0
3131
with:
32-
ruby-version: "3.2.2"
33-
bundler-cache: true
32+
pixi-version: v0.20.0
33+
cache: true
3434
- name: Update _config.yml ⚙️
3535
uses: fjogeleit/yaml-update-action@main
3636
with:
@@ -41,16 +41,14 @@ jobs:
4141
"giscus.repo": "${{ github.repository }}",
4242
"baseurl": ""
4343
}
44-
- name: Install and Build 🔧
44+
- name: Install dependencies 📦
45+
run: pixi install
46+
- name: Build site 🔧
4547
run: |
46-
sudo apt-get update && sudo apt-get install -y imagemagick
47-
pip3 install --upgrade jupyter
4848
export JEKYLL_ENV=production
49-
bundle exec jekyll build
49+
pixi run build
5050
- name: Purge unused CSS 🧹
51-
run: |
52-
npm install -g purgecss
53-
purgecss -c .js
51+
run: pixi run purgecss
5452
- name: Get Chromium version 🌐
5553
# https://github.com/GoogleChromeLabs/chrome-for-testing?tab=readme-ov-file#other-api-endpoints
5654
run: |

.github/workflows/broken-links-site.yml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ jobs:
1414
steps:
1515
- name: Checkout 🛎️
1616
uses: actions/checkout@v4
17-
- name: Setup Ruby
18-
uses: ruby/setup-ruby@v1
17+
- name: Install pixi 🦊
18+
uses: prefix-dev/setup-pixi@v0.10.0
1919
with:
20-
ruby-version: "3.2.2"
21-
bundler-cache: true
20+
pixi-version: v0.20.0
21+
cache: true
2222
- name: Update _config.yml ⚙️
2323
uses: fjogeleit/yaml-update-action@main
2424
with:
@@ -29,16 +29,14 @@ jobs:
2929
"giscus.repo": "${{ github.repository }}",
3030
"baseurl": ""
3131
}
32-
- name: Install and Build 🔧
32+
- name: Install dependencies 📦
33+
run: pixi install
34+
- name: Build site 🔧
3335
run: |
34-
sudo apt-get update && sudo apt-get install -y imagemagick
35-
pip3 install --upgrade jupyter
3636
export JEKYLL_ENV=production
37-
bundle exec jekyll build
37+
pixi run build
3838
- name: Purge unused CSS 🧹
39-
run: |
40-
npm install -g purgecss
41-
purgecss -c purgecss.config.js
39+
run: pixi run purgecss
4240
- name: Link Checker 🔗
4341
uses: lycheeverse/lychee-action@v1.9.0
4442
with:

.github/workflows/deploy.yml

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ on:
1717
- "**.yml"
1818
- "Gemfile"
1919
- "Gemfile.lock"
20+
- "pixi.toml"
21+
- "pixi.lock"
22+
- "requirements.txt"
2023
- "!.github/workflows/axe.yml"
2124
- "!.github/workflows/broken-links.yml"
2225
- "!.github/workflows/deploy-docker-tag.yml"
@@ -46,6 +49,9 @@ on:
4649
- "**.yml"
4750
- "Gemfile"
4851
- "Gemfile.lock"
52+
- "pixi.toml"
53+
- "pixi.lock"
54+
- "requirements.txt"
4955
- "!.github/workflows/axe.yml"
5056
- "!.github/workflows/broken-links.yml"
5157
- "!.github/workflows/deploy-docker-tag.yml"
@@ -71,33 +77,26 @@ jobs:
7177
steps:
7278
- name: Checkout 🛎️
7379
uses: actions/checkout@v4
74-
- name: Setup Ruby 💎
75-
uses: ruby/setup-ruby@v1
80+
- name: Install pixi 🦊
81+
uses: prefix-dev/setup-pixi@v0.10.0
7682
with:
77-
ruby-version: "3.3.5"
78-
bundler-cache: true
79-
- name: Setup Python 🐍
80-
uses: actions/setup-python@v5
81-
with:
82-
python-version: "3.13"
83-
cache: "pip" # caching pip dependencies
83+
pixi-version: v0.20.0
84+
cache: true
8485
- name: Update _config.yml ⚙️
8586
uses: fjogeleit/yaml-update-action@main
8687
with:
8788
commitChange: false
8889
valueFile: "_config.yml"
8990
propertyPath: "giscus.repo"
9091
value: ${{ github.repository }}
91-
- name: Install and Build 🔧
92+
- name: Install dependencies 📦
93+
run: pixi install
94+
- name: Build site 🔧
9295
run: |
93-
sudo apt-get update && sudo apt-get install -y imagemagick
94-
pip3 install --upgrade nbconvert
9596
export JEKYLL_ENV=production
96-
bundle exec jekyll build
97+
pixi run build
9798
- name: Purge unused CSS 🧹
98-
run: |
99-
npm install -g purgecss
100-
purgecss -c purgecss.config.js
99+
run: pixi run purgecss
101100
- name: Deploy 🚀
102101
if: github.event_name != 'pull_request'
103102
uses: JamesIves/github-pages-deploy-action@v4
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Update requirements.txt
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- main
8+
paths:
9+
- "pixi.toml"
10+
- "pixi.lock"
11+
workflow_dispatch:
12+
13+
permissions:
14+
contents: write
15+
16+
jobs:
17+
update-requirements:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout 🛎️
21+
uses: actions/checkout@v4
22+
- name: Install pixi 🦊
23+
uses: prefix-dev/setup-pixi@v0.10.0
24+
with:
25+
pixi-version: v0.20.0
26+
- name: Export requirements.txt 📝
27+
run: pixi run export-requirements
28+
- name: Check for changes
29+
id: verify-changed
30+
run: |
31+
if [ -n "$(git status --porcelain requirements.txt)" ]; then
32+
echo "changed=true" >> $GITHUB_OUTPUT
33+
else
34+
echo "changed=false" >> $GITHUB_OUTPUT
35+
fi
36+
- name: Commit changes
37+
if: steps.verify-changed.outputs.changed == 'true'
38+
run: |
39+
git config --local user.email "action@github.com"
40+
git config --local user.name "GitHub Action"
41+
git add requirements.txt
42+
git commit -m "chore: auto-update requirements.txt from pixi.toml" || exit 0
43+
git push

QUICK_TEST.md

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
# Quick Testing Guide
2+
3+
## 🚀 Fastest Way to Test
4+
5+
Run the automated test script:
6+
7+
```bash
8+
./test-setup.sh
9+
```
10+
11+
This will test:
12+
- ✅ pixi installation
13+
- ✅ Dependency installation
14+
- ✅ requirements.txt generation
15+
- ✅ Jekyll build
16+
- ✅ CSS purging
17+
18+
## 📋 Manual Testing Steps
19+
20+
### 1. Install Dependencies
21+
```bash
22+
pixi install
23+
```
24+
25+
### 2. Generate requirements.txt
26+
```bash
27+
pixi run export-requirements
28+
```
29+
30+
### 3. Build the Site
31+
```bash
32+
pixi run build
33+
```
34+
35+
### 4. Test Development Server (optional)
36+
```bash
37+
pixi run dev
38+
# Visit http://localhost:4000
39+
```
40+
41+
## 🔍 Verify Everything Works
42+
43+
### Check Dependencies
44+
```bash
45+
pixi list
46+
```
47+
48+
Should show: ruby, nodejs, python, imagemagick, nbconvert, etc.
49+
50+
### Check Generated Files
51+
```bash
52+
ls -la requirements.txt # Should exist
53+
ls -la _site/ # Should exist after build
54+
```
55+
56+
### Check Tasks
57+
```bash
58+
pixi task list
59+
```
60+
61+
Should show: install, dev, build, clean, export-requirements, purgecss
62+
63+
## 🧪 Test GitHub Actions
64+
65+
### Option 1: Manual Trigger
66+
1. Go to GitHub → Actions
67+
2. Select "Update requirements.txt"
68+
3. Click "Run workflow" → "Run workflow"
69+
70+
### Option 2: Trigger by Changing pixi.toml
71+
1. Edit `pixi.toml` (change a version or add a comment)
72+
2. Commit and push
73+
3. Watch the workflow run automatically
74+
75+
### Option 3: Test Deploy Workflow
76+
1. Make a small change to any markdown file
77+
2. Commit and push
78+
3. Check Actions tab for "Deploy site" workflow
79+
80+
## ⚠️ Common Issues
81+
82+
**"pixi: command not found"**
83+
→ Install pixi: https://pixi.sh/install/
84+
85+
**"bundle: command not found"**
86+
→ Run `pixi install` first (it installs bundler)
87+
88+
**Build fails**
89+
→ Check that all dependencies are installed: `pixi list`
90+
91+
**Workflow fails in GitHub Actions**
92+
→ Check workflow logs in Actions tab for specific errors
93+
94+
## ✅ Success Checklist
95+
96+
- [ ] `pixi install` works
97+
- [ ] `pixi run export-requirements` creates requirements.txt
98+
- [ ] `pixi run build` creates _site directory
99+
- [ ] `pixi run dev` starts server (optional)
100+
- [ ] GitHub Actions workflows run successfully
101+
- [ ] requirements.txt auto-updates when pixi.toml changes

0 commit comments

Comments
 (0)