No description
Find a file
Karl Beck 8b4b3b50c8
Some checks are pending
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/manual/woodpecker Pipeline is pending
frontend
2025-09-12 10:51:55 +02:00
frontend build angular 2025-09-12 09:15:07 +02:00
.dockerignore init base docker build 2025-09-10 16:48:28 +02:00
.woodpecker.env frontend 2025-09-12 10:51:55 +02:00
.woodpecker.yml frontend full 2025-09-12 10:47:26 +02:00
Dockerfile build angular 2025-09-12 09:15:07 +02:00
index.html init base docker build 2025-09-10 16:48:28 +02:00
nginx.conf build angular 2025-09-12 09:15:07 +02:00
README.md init base docker build 2025-09-10 16:48:28 +02:00
woodpecker_lint.sh 1530 2025-09-11 15:30:55 +02:00

Demo CI Application

A simple demonstration application for Woodpecker CI with Forgejo Docker registry integration.

Overview

This project demonstrates:

  • Building a Docker container with Woodpecker CI
  • Pushing images to Forgejo's Docker package registry
  • Automated CI/CD pipeline configuration

Files Structure

.
├── .woodpecker.yml     # Woodpecker CI configuration
├── Dockerfile          # Container build instructions
├── index.html         # Demo application content
└── README.md          # This file

Woodpecker CI Configuration

The .woodpecker.yml file defines a pipeline that:

  1. Build Step: Creates a Docker image tagged with commit SHA and latest
  2. Publish Step: Pushes the image to Forgejo's Docker registry (only on main branch)
  3. Cleanup Step: Removes unused Docker resources

Required Secrets

Configure these secrets in your Woodpecker CI settings:

  • registry_username: Your Forgejo username
  • registry_password: Your Forgejo password or access token

Environment Variables Used

  • CI_FORGE_URL: Automatically provided by Woodpecker (your Forgejo instance URL)
  • CI_COMMIT_SHA: Git commit SHA for tagging
  • CI_REPO_OWNER: Repository owner for namespacing

Docker Registry

Images are pushed to: {FORGEJO_URL}/{REPO_OWNER}/demo-app

Tags:

  • latest: Always points to the latest main branch build
  • {commit-sha}: Specific commit builds for traceability

Local Development

Build locally:

docker build -t demo-app .

Run locally:

docker run -p 8080:80 demo-app

Then visit http://localhost:8080

Test the container:

# Health check
curl http://localhost:8080

# Check container logs
docker logs <container-id>

Deployment

The pipeline automatically:

  1. Triggers on pushes to main branch and pull requests
  2. Builds the Docker image
  3. Pushes to registry (main branch only)
  4. Cleans up build artifacts

Customization

To adapt this for your project:

  1. Update the image_name variable in .woodpecker.yml
  2. Modify the Dockerfile for your application needs
  3. Replace index.html with your application files
  4. Adjust the pipeline steps as needed

Security Notes

  • Uses Docker-in-Docker for container builds
  • Registry credentials are securely managed via Woodpecker secrets
  • Images are tagged with commit SHAs for traceability
  • Cleanup step prevents disk space issues