A Python bot that automatically fetches the daily Worldle country shape and uploads it to Slack.
- Automatically fetches the daily Worldle country shape
- Converts SVG to PNG with white background
- Uploads to Slack channel
- Runs in Docker container
This project includes automated CI/CD pipeline that:
-
Lints the code using:
- Black (code formatter)
- isort (import sorter)
- flake8 (linter)
- mypy (type checker)
-
Builds and pushes Docker images to:
- Docker Hub
- GitHub Container Registry (GHCR)
The pipeline runs on:
- Pull requests to
mainbranch (linting only) - Pushes to
mainbranch (linting + build + push)
To enable Docker image pushing, you need to set up the following secrets in your GitHub repository:
- Go to your GitHub repository → Settings → Secrets and variables → Actions
- Add the following secrets:
DOCKERHUB_USERNAME: Your Docker Hub usernameDOCKERHUB_TOKEN: Your Docker Hub access token (not your password)
- No additional secrets needed - uses the built-in
GITHUB_TOKEN
- Log in to Docker Hub
- Go to Account Settings → Security
- Click "New Access Token"
- Give it a name (e.g., "GitHub Actions")
- Copy the token and add it as
DOCKERHUB_TOKENin your GitHub secrets
# Install dependencies
pip install -r requirements.txt
# Run the bot
python main.py# Build the image
docker build -t worldle-bot .
# Run the container
docker run -e SLACK_BOT_TOKEN=your_token -e SLACK_CHANNEL=your_channel worldle-botSLACK_BOT_TOKEN: Your Slack bot tokenSLACK_CHANNEL: The Slack channel ID to post toOUTPUT_DIR: Directory to save images (default:/app/output)
The CI/CD pipeline creates the following image tags:
latest: Latest build from main branchmain: Latest build from main branchsha-{commit}: Specific commit SHA- Semantic version tags (when using git tags)
docker.io/{username}/worldle-bot:{tag}
ghcr.io/{username}/worldle-bot:{tag}