Deploy Pelican with DeployHQ Guide
Prerequisites
- A Pelican site ready for deployment
- A Git repository (GitHub, GitLab, or Bitbucket) containing your Pelican project
- A web hosting service or server to deploy to
Initial Setup
1. Create your Pelican site
# Install Pelican with Markdown support
python -m pip install "pelican[markdown]"
# Create project directory
mkdir -p ~/projects/yoursite
cd ~/projects/yoursite
# Initialize Pelican project
pelican-quickstart
# Create sample content
echo 'Title: My First Post
Date: 2023-01-01 10:00
Category: General
This is my first post.' > content/first-post.md
# Generate site
pelican content
2. Initialize Git repository
git init
git add .
git commit -m "Initial commit"
git remote add origin <your-repository-url>
git push -u origin main
DeployHQ Configuration
1. Create DeployHQ Account
- Visit DeployHQ
- Sign up for a new account
2. Create New Project
- Click "New Project" in DeployHQ dashboard
- Choose a name for your project
- Select your repository provider (GitHub/GitLab/Bitbucket)
- Grant repository access when prompted
3. Configure Server
- Click "Servers & Groups" in project settings
- Select "Add Server"
- Choose your server type (FTP/SFTP/SSH)
- Enter server details:
- Server name
- Hostname
- Username
- Password/SSH key
- Remote path (where files will be deployed)
4. Configure Build Pipeline
- Go to "Build Pipeline" in project settings
- Click "Add New Pipeline Command"
- Add the following commands:
# Install Python and requirements
python -m pip install "pelican[markdown]"
# Generate site
pelican content -o build
5. Configure Deployment
- Go to "Deployment Config"
- Set build directory to
build/
- Configure included/excluded files:
# Include
build/**/*
# Exclude
content/**/*
*.py
*.pyc
requirements.txt
6. Set Up Automatic Deployments
- Go to "Automatic Deployments"
- Enable automatic deployments for your branch (usually
main
) - Configure deployment triggers (e.g., on push)
First Deployment
1. Manual Deployment
- Go to "Deployments" in project dashboard
- Click "Deploy Now"
- Select branch to deploy
- Review changes and confirm
2. Verify Deployment
- Check deployment logs for any errors
- Visit your website to confirm successful deployment
- Verify all static files are properly served
Ongoing Usage
1. Regular Updates
# Make changes to your content
git add .
git commit -m "Update content"
git push origin main
2. Monitor Deployments
- Check DeployHQ dashboard for deployment status
- Review logs for any issues
- Configure notifications for deployment events
Troubleshooting
- Build Failures: Check build logs for Python or Pelican errors
- Missing Files: Verify build directory and inclusion rules
- Permission Issues: Check server permissions and deployment user access
- Static Files: Ensure proper configuration of static file handling
Best Practices
- Use environment variables for sensitive information
- Implement staging environments for testing
- Regular backup of deployment configurations
- Monitor deployment logs for potential issues
- Keep Pelican and dependencies updated
This guide provides a comprehensive approach to deploying Pelican sites using DeployHQ. Adjust configurations based on your specific needs and hosting environment.