Compare commits

...

2 commits

Author SHA1 Message Date
Cody Cook
83c4af4bc5 Build packages, maybe?
Some checks are pending
Build and Publish / test (push) Waiting to run
Build and Publish / build (push) Blocked by required conditions
Build and Publish / notify (push) Blocked by required conditions
/ test (push) Waiting to run
2025-06-17 20:17:28 -07:00
Cody Cook
8937182cab Build packages, maybe? 2025-06-17 20:17:23 -07:00
5 changed files with 257 additions and 4 deletions

View file

@ -1,3 +1,7 @@
# NOTE: This Drone CI configuration is being replaced by Forgejo Actions
# See .forgejo/workflows/ directory for the new CI/CD configuration
# This file is kept for reference and backward compatibility
kind: pipeline
type: docker
name: podcastrr
@ -48,4 +52,4 @@ trigger:
- main
event:
- push
- pull_request
- pull_request

View file

@ -0,0 +1,79 @@
name: Build and Publish
on:
push:
branches:
- main
tags:
- 'v*'
pull_request:
branches:
- main
jobs:
test:
runs-on: docker
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run tests
run: |
pytest
build:
needs: test
runs-on: docker
if: github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Forgejo Container Registry
uses: docker/login-action@v2
with:
registry: ${{ secrets.FORGEJO_REGISTRY }}
username: ${{ secrets.FORGEJO_USERNAME }}
password: ${{ secrets.FORGEJO_PASSWORD }}
- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ secrets.FORGEJO_REGISTRY }}/${{ secrets.FORGEJO_USERNAME }}/podcastrr
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=sha,format=short
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=${{ secrets.FORGEJO_REGISTRY }}/${{ secrets.FORGEJO_USERNAME }}/podcastrr:buildcache
cache-to: type=registry,ref=${{ secrets.FORGEJO_REGISTRY }}/${{ secrets.FORGEJO_USERNAME }}/podcastrr:buildcache,mode=max
notify:
needs: [build]
runs-on: docker
if: always()
steps:
- name: Notify about build status
run: |
echo "Build completed with status: ${{ job.status }}"
# Add webhook notification or other notification methods if needed

View file

@ -0,0 +1,6 @@
on: [push]
jobs:
test:
runs-on: docker
steps:
- run: echo All Good

135
README_ACTIONS.md Normal file
View file

@ -0,0 +1,135 @@
# Podcastrr - Forgejo Actions Guide
This document provides detailed information about the Forgejo Actions implementation in this project.
## Overview
Forgejo Actions is a CI/CD feature provided by Forgejo that allows you to automate your software development workflows. This project uses Forgejo Actions to automate testing, building, and publishing Docker images.
## Workflow Files
All workflow files are located in the `.forgejo/workflows/` directory:
### 1. Demo Workflow (demo.yaml)
A simple example workflow that demonstrates basic Forgejo Actions functionality:
```yaml
on: [push]
jobs:
test:
runs-on: docker
steps:
- run: echo All Good
```
This workflow:
- Runs on every push to any branch
- Uses a Docker container as the execution environment
- Simply outputs "All Good" to demonstrate successful execution
### 2. Build and Publish Workflow (build.yml)
A comprehensive CI/CD pipeline that handles testing, building, and publishing:
```yaml
name: Build and Publish
on:
push:
branches:
- main
tags:
- 'v*'
pull_request:
branches:
- main
jobs:
test:
# Test job configuration
# ...
build:
# Build job configuration
# ...
notify:
# Notification job configuration
# ...
```
This workflow:
- Runs on pushes to the main branch, any tag starting with 'v', and pull requests to the main branch
- Contains three jobs: test, build, and notify
- Uses Docker containers for all jobs
- Builds and publishes Docker images to the Forgejo container registry
## How to Use
### Prerequisites
1. Ensure your Forgejo instance has Actions enabled
2. Configure the required secrets in your repository settings:
- `FORGEJO_REGISTRY`: Your Forgejo container registry URL
- `FORGEJO_USERNAME`: Your Forgejo username
- `FORGEJO_PASSWORD`: Your Forgejo password
### Enabling Actions
1. Go to your repository settings
2. Navigate to the Repository tab
3. Ensure "Enable Repository Actions" is checked
4. Save your settings
### Viewing Workflow Results
1. Go to your repository
2. Click on the "Actions" tab
3. You'll see a list of workflow runs
4. Click on a run to see details and logs
### Triggering Workflows Manually
Some workflows can be triggered manually:
1. Go to your repository
2. Click on the "Actions" tab
3. Select the workflow you want to run
4. Click "Run workflow"
5. Select the branch and provide any inputs if required
6. Click "Run workflow"
## Customizing Workflows
You can customize the existing workflows or create new ones:
1. Edit the files in the `.forgejo/workflows/` directory
2. Commit and push your changes
3. The updated workflows will be used for future runs
## Troubleshooting
### Common Issues
1. **Workflow not running**:
- Check if Actions is enabled in your repository settings
- Verify that the workflow file syntax is correct
2. **Build failures**:
- Check the workflow run logs for error messages
- Ensure all required secrets are configured correctly
3. **Docker image not publishing**:
- Verify your container registry credentials
- Check if your Forgejo instance has the container registry enabled
### Getting Help
If you encounter issues with Forgejo Actions, consult the [Forgejo documentation](https://forgejo.org/docs/) or open an issue in this repository.
## References
- [Forgejo Actions User Guide](https://forgejo.org/docs/actions/)
- [Forgejo Documentation](https://forgejo.org/docs/)
- [Docker Documentation](https://docs.docker.com/)

View file

@ -5,7 +5,7 @@ This guide explains how to set up and use Podcastrr with Forgejo for CI/CD and c
## Prerequisites
- A Forgejo instance with:
- CI/CD capabilities (Drone integration)
- Forgejo Actions enabled (preferred) or CI/CD capabilities (Drone integration)
- Container registry enabled
- Docker and Docker Compose installed on your local machine
- Git installed on your local machine
@ -28,19 +28,48 @@ This guide explains how to set up and use Podcastrr with Forgejo for CI/CD and c
In your Forgejo repository settings, add the following secrets:
#### For Forgejo Actions (Recommended)
Navigate to your repository settings, then Actions, then Secrets:
- `FORGEJO_REGISTRY`: Your Forgejo container registry URL (e.g., `registry.your-forgejo-instance.com`)
- `FORGEJO_USERNAME`: Your Forgejo username
- `FORGEJO_PASSWORD`: Your Forgejo password
#### For Drone CI (Legacy)
Navigate to your repository settings, then Secrets:
- `docker_username`: Your Forgejo username or container registry username
- `docker_password`: Your Forgejo password or container registry password
- `webhook_url` (optional): URL for build notifications
### 3. Environment Variables
#### For Drone CI (Legacy)
Configure the following environment variables in your Forgejo CI/CD settings:
- `DRONE_REGISTRY`: Your Forgejo container registry URL (e.g., `registry.your-forgejo-instance.com`)
## CI/CD Pipeline
The included `.drone.yml` file defines a CI/CD pipeline that:
### Forgejo Actions (Recommended)
The project includes Forgejo Actions workflows in the `.forgejo/workflows/` directory:
1. **Demo Workflow** (`.forgejo/workflows/demo.yaml`): A simple example workflow that runs on every push.
2. **Build and Publish Workflow** (`.forgejo/workflows/build.yml`): A comprehensive CI/CD pipeline that:
- Runs tests on every push and pull request
- Builds and pushes a Docker image to your container registry on pushes to the main branch or tags
- Provides build status notifications
To use Forgejo Actions:
1. Ensure "Enable Repository Actions" is checked in your repository settings
2. The workflows will automatically run when you push to the repository
3. View results in the Actions tab of your repository
### Drone CI (Legacy)
The included `.drone.yml` file defines a legacy CI/CD pipeline that:
1. Runs tests on every push and pull request
2. Builds and pushes a Docker image to your container registry on pushes to the main branch
@ -103,4 +132,4 @@ docker build -t podcastrr:local .
- [Forgejo Documentation](https://forgejo.org/docs/)
- [Drone CI Documentation](https://docs.drone.io/)
- [Docker Documentation](https://docs.docker.com/)
- [Docker Documentation](https://docs.docker.com/)