6.7 KiB
6.7 KiB
Scaleway Deployment Guide for notebook.arnodo.fr
This guide explains how to deploy your Hugo website to Scaleway using Gitea Actions and serve it at notebook.arnodo.fr.
Architecture Overview
Gitea (gitea.arnodo.fr) → Gitea Actions → Build Hugo → Deploy to Scaleway Object Storage → Served via notebook.arnodo.fr
Prerequisites
- Scaleway account
- Scaleway CLI installed (optional but recommended)
- Domain
arnodo.frwith DNS control - Gitea Actions enabled on your Gitea instance
Step 1: Create Scaleway Object Storage Bucket
Via Scaleway Console:
- Go to Object Storage in Scaleway console
- Click Create a bucket
- Name:
notebook-arnodo-fr(or your choice) - Region:
fr-par(Paris) - recommended for France - Click Create bucket
Via Scaleway CLI:
scw object bucket create name=notebook-arnodo-fr region=fr-par
Step 2: Configure Bucket for Static Website Hosting
Via Console:
- Go to your bucket
- Click Bucket settings
- Enable Website configuration
- Set index document:
index.html - Set error document:
404.html
Via CLI:
scw object bucket update notebook-arnodo-fr website-enable=true website-index=index.html website-error=404.html region=fr-par
Step 3: Create Scaleway API Keys
- Go to IAM → API Keys
- Click Generate API key
- Name it:
gitea-ci-deployment - Save both:
- Access Key ID
- Secret Access Key
Step 4: Configure Bucket Policy for Public Read
Create a bucket policy to allow public read access:
{
"Version": "2023-04-17",
"Id": "PublicRead",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "notebook-arnodo-fr/*"
}
]
}
Apply via CLI:
cat > policy.json << EOF
{
"Version": "2023-04-17",
"Id": "PublicRead",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "notebook-arnodo-fr/*"
}
]
}
EOF
scw object bucket update notebook-arnodo-fr --policy=@policy.json region=fr-par
Step 5: Configure Gitea Secrets
Add these secrets to your Gitea repository:
- Go to your Notebook repository in Gitea
- Navigate to Settings → Secrets
- Add the following secrets:
SCW_ACCESS_KEY: Your Scaleway Access KeySCW_SECRET_KEY: Your Scaleway Secret KeySCW_BUCKET_NAME:notebook-arnodo-fr
Step 6: DNS Configuration
Option A: Direct S3 Bucket Access (Simple)
Add a CNAME record:
notebook.arnodo.fr CNAME notebook-arnodo-fr.s3-website.fr-par.scw.cloud.
Note: The bucket URL will be: http://notebook-arnodo-fr.s3-website.fr-par.scw.cloud
Option B: Using Scaleway CDN (Recommended for Production)
- Go to Scaleway CDN in console
- Create a new CDN endpoint
- Origin: Your bucket endpoint
- Custom domain:
notebook.arnodo.fr - Enable SSL/TLS
- Add CNAME record as provided by Scaleway
Option C: Using Nginx Reverse Proxy on Scaleway Instance
If you want more control:
- Create a Scaleway Instance (smallest one: DEV1-S)
- Install Nginx
- Configure Nginx to proxy to your S3 bucket
Nginx config example:
server {
listen 80;
server_name notebook.arnodo.fr;
location / {
proxy_pass http://notebook-arnodo-fr.s3-website.fr-par.scw.cloud;
proxy_set_header Host notebook-arnodo-fr.s3-website.fr-par.scw.cloud;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
- Set up Let's Encrypt for HTTPS:
sudo apt install certbot python3-certbot-nginx
sudo certbot --nginx -d notebook.arnodo.fr
Step 7: Test the Deployment
- Commit and push to the
mainbranch - Check Gitea Actions for build status
- Verify files are uploaded to Scaleway bucket
- Access your site at
notebook.arnodo.fr
Verification Commands
Check bucket contents:
s3cmd ls s3://notebook-arnodo-fr/
Test website endpoint:
curl -I http://notebook-arnodo-fr.s3-website.fr-par.scw.cloud
Cost Estimation (Scaleway)
Object Storage:
- Storage: €0.01 per GB/month
- Outbound traffic: First 75 GB free, then €0.01 per GB
- Typical blog (1 GB): ~€0.01/month + traffic
Optional Instance (if using reverse proxy):
- DEV1-S:
€0.01/hour (€7/month) - With 100% uptime SLA: ~€10/month
CDN (if needed):
- €1/month base + traffic costs
Troubleshooting
Build fails in Gitea Actions
- Check Hugo version compatibility
- Verify theme submodules are properly checked out
- Check build logs in Gitea Actions tab
Files not accessible
- Verify bucket policy allows public read
- Check bucket website configuration
- Ensure files were uploaded (check s3cmd output)
DNS not resolving
- Wait for DNS propagation (up to 48 hours, usually minutes)
- Verify CNAME record with:
dig notebook.arnodo.fr - Check TTL settings
SSL Certificate Issues
- If using reverse proxy, ensure Certbot ran successfully
- If using CDN, verify SSL certificate provisioning in Scaleway console
Migration from GitHub Pages
- Remove GitHub Actions workflow (or keep both temporarily)
- Update any hardcoded URLs in your Hugo config
- Verify all functionality works on Scaleway
- Update DNS from GitHub Pages to Scaleway
- Remove GitHub Pages when satisfied
Advanced: Cache Invalidation
If using Scaleway CDN, add cache invalidation to workflow:
# Install Scaleway CLI in workflow
- name: Install Scaleway CLI
run: |
curl -o /usr/local/bin/scw -L "https://github.com/scaleway/scaleway-cli/releases/latest/download/scaleway-cli_$(uname -s)_$(uname -m)"
chmod +x /usr/local/bin/scw
- name: Invalidate CDN cache
run: |
scw edge invalidate path=/* zone=fr-par
env:
SCW_ACCESS_KEY: ${{ secrets.SCW_ACCESS_KEY }}
SCW_SECRET_KEY: ${{ secrets.SCW_SECRET_KEY }}
Monitoring
Set up Scaleway monitoring:
- Enable bucket metrics in Scaleway console
- Configure alerts for:
- High traffic usage
- Failed requests
- Storage size
Backup Strategy
While Object Storage is highly durable, consider:
- Git repository is your source of truth
- Enable Object Storage versioning
- Consider cross-region replication for critical sites
Next Steps
- Enable HTTPS (via CDN or reverse proxy)
- Configure custom error pages
- Set up monitoring and alerts
- Optimize images and assets
- Consider adding a CDN for global performance
For questions or issues, refer to: