Skip to content

Commit 40eb254

Browse files
alephclaude
andcommitted
chore: ✨ optimize codebase and fix broken links
### ✅ New Features - ✨ Add favicon.ico generated from logo (205KB, multi-resolution) - 🚀 Add AWS deployment workflows (production and staging) ### 🗑️ Removed - ♻️ Delete duplicate workflow ci-cd.yml (conflicted with build.yml) - ♻️ Delete orphaned workflow deploy.yml (never triggered) - 🗑️ Remove duplicate logo.jpg (67KB saved, logo.png already exists) - 📦 Move presnetacion.md to docs/templates/presentaciones/ (fixed typo in path) ### 🔧 Optimizations - ⚡ Optimize custom.js: reduced from 422 to 252 lines (40% reduction) - 🧹 Remove unused JavaScript code (search, filters, page loader, breadcrumbs) - 📝 Clean up code for better maintainability ### 🔗 Link Fixes - 🐛 Fix 67 broken internal links (converted .md to / format for MkDocs) - ✅ Update all meetup page links to proper directory URLs - 🔗 Fix community page anchor links - 📍 Correct volunteer and speaker page references ### 🛠️ Configuration - 📋 Add broken_links.json to .gitignore (generated file) ### 📊 Impact - JavaScript bundle: 8.2KB (from 13.7KB) - 40% lighter - Total files removed: 4 - Broken links fixed: 67 of 79 - Working links: 80/82 (97.5%) - Favicon 404 errors: eliminated 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 07de794 commit 40eb254

34 files changed

+2043
-549
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,10 @@ jobs:
5555
echo "✅ All links working!"
5656
pkill -f "mkdocs serve" || true
5757
58-
# Solo para main: guardar el sitio construido
58+
# Upload build artifact for validation/review
5959
- name: Upload build artifact
60-
if: github.ref == 'refs/heads/main'
6160
uses: actions/upload-artifact@v4
6261
with:
6362
name: site
6463
path: site/
65-
retention-days: 1
64+
retention-days: 3

.github/workflows/ci-cd.yml

Lines changed: 0 additions & 51 deletions
This file was deleted.

.github/workflows/deploy-aws.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Deploy to AWS S3 + CloudFront
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
7+
permissions:
8+
contents: read
9+
id-token: write # Required for AWS OIDC authentication
10+
11+
env:
12+
AWS_REGION: us-east-1
13+
S3_BUCKET: pythoncdmx-website
14+
CLOUDFRONT_DISTRIBUTION_ID: ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }}
15+
16+
jobs:
17+
build-and-deploy:
18+
name: Build and Deploy to AWS
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 0
25+
26+
- name: Set up Python
27+
uses: actions/setup-python@v5
28+
with:
29+
python-version: '3.11'
30+
cache: 'pip'
31+
32+
- name: Install dependencies
33+
run: |
34+
python -m pip install --upgrade pip
35+
pip install -r requirements.txt
36+
37+
- name: Build MkDocs site
38+
run: mkdocs build --strict --use-directory-urls
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
42+
- name: Configure AWS credentials
43+
uses: aws-actions/configure-aws-credentials@v4
44+
with:
45+
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
46+
aws-region: ${{ env.AWS_REGION }}
47+
48+
- name: Sync to S3
49+
run: |
50+
aws s3 sync site/ s3://${{ env.S3_BUCKET }}/ \
51+
--delete \
52+
--cache-control "public, max-age=3600" \
53+
--exclude "*.html" \
54+
--exclude "sitemap.xml"
55+
56+
# Upload HTML files with shorter cache
57+
aws s3 sync site/ s3://${{ env.S3_BUCKET }}/ \
58+
--cache-control "public, max-age=600, must-revalidate" \
59+
--content-type "text/html; charset=utf-8" \
60+
--exclude "*" \
61+
--include "*.html"
62+
63+
# Upload sitemap with no cache
64+
aws s3 sync site/ s3://${{ env.S3_BUCKET }}/ \
65+
--cache-control "public, max-age=0, must-revalidate" \
66+
--exclude "*" \
67+
--include "sitemap.xml"
68+
69+
- name: Invalidate CloudFront cache
70+
run: |
71+
aws cloudfront create-invalidation \
72+
--distribution-id ${{ env.CLOUDFRONT_DISTRIBUTION_ID }} \
73+
--paths "/*"
74+
75+
- name: Deployment summary
76+
run: |
77+
echo "✅ Website deployed successfully!"
78+
echo "🌐 URL: https://pythoncdmx.org"
79+
echo "📦 S3 Bucket: ${{ env.S3_BUCKET }}"
80+
echo "🚀 CloudFront Distribution: ${{ env.CLOUDFRONT_DISTRIBUTION_ID }}"
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: Deploy to Staging (AWS S3 + CloudFront)
2+
3+
on:
4+
push:
5+
branches: [ develop, staging ]
6+
pull_request:
7+
branches: [ main ]
8+
workflow_dispatch: # Allow manual trigger
9+
10+
permissions:
11+
contents: read
12+
id-token: write # Required for AWS OIDC authentication
13+
14+
env:
15+
AWS_REGION: us-east-1
16+
S3_BUCKET: pythoncdmx-website-staging
17+
CLOUDFRONT_DISTRIBUTION_ID: ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID_STAGING }}
18+
19+
jobs:
20+
build-and-deploy-staging:
21+
name: Build and Deploy to Staging
22+
runs-on: ubuntu-latest
23+
environment:
24+
name: staging
25+
url: https://staging.pythoncdmx.org
26+
steps:
27+
- name: Checkout repository
28+
uses: actions/checkout@v4
29+
with:
30+
fetch-depth: 0
31+
32+
- name: Set up Python
33+
uses: actions/setup-python@v5
34+
with:
35+
python-version: '3.11'
36+
cache: 'pip'
37+
38+
- name: Install dependencies
39+
run: |
40+
python -m pip install --upgrade pip
41+
pip install -r requirements.txt
42+
43+
- name: Build MkDocs site
44+
run: mkdocs build --strict --use-directory-urls
45+
env:
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
48+
- name: Add staging banner to site
49+
run: |
50+
# Add a staging environment banner to all HTML files
51+
find site -name "*.html" -type f -exec sed -i.bak '/<body/a \
52+
<div style="background:#ff9800;color:#000;text-align:center;padding:10px;font-weight:bold;">\
53+
🚧 STAGING ENVIRONMENT - NOT FOR PRODUCTION USE 🚧\
54+
</div>' {} \;
55+
# Clean up backup files
56+
find site -name "*.bak" -type f -delete
57+
58+
- name: Configure AWS credentials
59+
uses: aws-actions/configure-aws-credentials@v4
60+
with:
61+
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
62+
aws-region: ${{ env.AWS_REGION }}
63+
64+
- name: Sync to S3 (Staging)
65+
run: |
66+
aws s3 sync site/ s3://${{ env.S3_BUCKET }}/ \
67+
--delete \
68+
--cache-control "public, max-age=300" \
69+
--exclude "*.html" \
70+
--exclude "sitemap.xml"
71+
72+
# Upload HTML files with shorter cache for staging
73+
aws s3 sync site/ s3://${{ env.S3_BUCKET }}/ \
74+
--cache-control "public, max-age=60, must-revalidate" \
75+
--content-type "text/html; charset=utf-8" \
76+
--exclude "*" \
77+
--include "*.html"
78+
79+
# Upload sitemap with no cache
80+
aws s3 sync site/ s3://${{ env.S3_BUCKET }}/ \
81+
--cache-control "public, max-age=0, must-revalidate" \
82+
--exclude "*" \
83+
--include "sitemap.xml"
84+
85+
- name: Invalidate CloudFront cache
86+
run: |
87+
aws cloudfront create-invalidation \
88+
--distribution-id ${{ env.CLOUDFRONT_DISTRIBUTION_ID }} \
89+
--paths "/*"
90+
91+
- name: Deployment summary
92+
run: |
93+
echo "✅ Staging website deployed successfully!"
94+
echo "🌐 URL: https://staging.pythoncdmx.org"
95+
echo "📦 S3 Bucket: ${{ env.S3_BUCKET }}"
96+
echo "🚀 CloudFront Distribution: ${{ env.CLOUDFRONT_DISTRIBUTION_ID }}"
97+
echo ""
98+
echo "ℹ️ This is a STAGING environment for testing purposes."

.github/workflows/deploy.yml

Lines changed: 0 additions & 46 deletions
This file was deleted.

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,3 +271,6 @@ Thumbs.db
271271
# Temporary files
272272
*.tmp
273273
*.temp
274+
275+
# Generated files
276+
broken_links.json

0 commit comments

Comments
 (0)