Skip to content

Instantly share code, notes, and snippets.

@castrojo
Created August 3, 2025 17:55
Show Gist options
  • Save castrojo/99289fc158eae5241524d67d2bd2eed5 to your computer and use it in GitHub Desktop.
Save castrojo/99289fc158eae5241524d67d2bd2eed5 to your computer and use it in GitHub Desktop.
name: Generate Torrent & Deploy to Cloudflare
on:
# Trigger the workflow on pushes to the main branch (or other events)
push:
branches:
- main
jobs:
generate_and_deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Generate Torrent File
# Use an existing action or run a custom script
uses: devopsx/action-torrent@v1
with:
files: 'path/to/your/files/' # Specify files for the torrent
output_dir: 'torrents/'
- name: Publish to Cloudflare Pages (or deploy Worker)
# Use the Cloudflare Pages Action
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: 'your-cloudflare-pages-project'
directory: 'torrents/' # Directory containing the generated torrents
# Alternatively, use the Wrangler Action for Cloudflare Workers
# uses: cloudflare/wrangler-action@v3
# with:
# apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
# accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
# # Add your Worker deployment specifics here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment