9dc82c8490
The github-release plugin was incorrectly detecting and using the Gitea API instead of GitHub's API. Replaced with direct curl command that explicitly calls GitHub API to create releases. This approach: - Uses curlimages/curl image for lightweight execution - Directly calls GitHub API v3 with proper authentication - Avoids any auto-detection issues from the plugin - Creates releases with full markdown formatting 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
143 lines
4.3 KiB
YAML
143 lines
4.3 KiB
YAML
kind: pipeline
|
|
type: docker
|
|
name: default
|
|
|
|
steps:
|
|
# Build Backend Docker Image
|
|
- name: build-backend
|
|
image: plugins/docker
|
|
settings:
|
|
repo: registry.local.nothaft.cloud/picpeak-backend
|
|
tags:
|
|
- latest
|
|
- ${DRONE_COMMIT_SHA:0:8}
|
|
- ${DRONE_BRANCH}-latest
|
|
dockerfile: backend/Dockerfile
|
|
context: backend/
|
|
registry: registry.local.nothaft.cloud
|
|
build_args:
|
|
- VERSION=${DRONE_TAG:-dev}
|
|
|
|
# Build Frontend Docker Image
|
|
- name: build-frontend
|
|
image: plugins/docker
|
|
settings:
|
|
repo: registry.local.nothaft.cloud/picpeak-frontend
|
|
tags:
|
|
- latest
|
|
- ${DRONE_COMMIT_SHA:0:8}
|
|
- ${DRONE_BRANCH}-latest
|
|
dockerfile: frontend/Dockerfile
|
|
context: frontend/
|
|
registry: registry.local.nothaft.cloud
|
|
build_args:
|
|
- VERSION=${DRONE_TAG:-dev}
|
|
- VITE_API_URL=${VITE_API_URL:-/api}
|
|
|
|
trigger:
|
|
branch:
|
|
- main
|
|
- develop
|
|
event:
|
|
- push
|
|
- pull_request
|
|
|
|
---
|
|
kind: pipeline
|
|
type: docker
|
|
name: release
|
|
|
|
steps:
|
|
# Build Backend Release
|
|
- name: build-backend-release
|
|
image: plugins/docker
|
|
settings:
|
|
repo: registry.local.nothaft.cloud/picpeak-backend
|
|
tags:
|
|
- ${DRONE_TAG}
|
|
- latest
|
|
dockerfile: backend/Dockerfile
|
|
context: backend/
|
|
registry: registry.local.nothaft.cloud
|
|
|
|
# Build Frontend Release
|
|
- name: build-frontend-release
|
|
image: plugins/docker
|
|
settings:
|
|
repo: registry.local.nothaft.cloud/picpeak-frontend
|
|
tags:
|
|
- ${DRONE_TAG}
|
|
- latest
|
|
dockerfile: frontend/Dockerfile
|
|
context: frontend/
|
|
registry: registry.local.nothaft.cloud
|
|
|
|
# -------- NEW: Publish Docker images to GitHub Container Registry --------
|
|
- name: push-backend-ghcr
|
|
image: plugins/docker
|
|
settings:
|
|
repo: ghcr.io/the-luap/picpeak-backend
|
|
tags:
|
|
- ${DRONE_TAG}
|
|
- latest
|
|
dockerfile: backend/Dockerfile
|
|
context: backend/
|
|
registry: ghcr.io
|
|
username:
|
|
from_secret: GITHUB_USERNAME
|
|
password:
|
|
from_secret: GITHUB_TOKEN
|
|
build_args:
|
|
- VERSION=${DRONE_TAG}
|
|
|
|
- name: push-frontend-ghcr
|
|
image: plugins/docker
|
|
settings:
|
|
repo: ghcr.io/the-luap/picpeak-frontend
|
|
tags:
|
|
- ${DRONE_TAG}
|
|
- latest
|
|
dockerfile: frontend/Dockerfile
|
|
context: frontend/
|
|
registry: ghcr.io
|
|
username:
|
|
from_secret: GITHUB_USERNAME
|
|
password:
|
|
from_secret: GITHUB_TOKEN
|
|
build_args:
|
|
- VERSION=${DRONE_TAG}
|
|
- VITE_API_URL=${VITE_API_URL:-/api}
|
|
|
|
# -------- NEW: Create GitHub Release --------
|
|
- name: github-release
|
|
image: curlimages/curl:latest
|
|
when:
|
|
event: tag
|
|
environment:
|
|
GITHUB_TOKEN:
|
|
from_secret: GITHUB_TOKEN
|
|
commands:
|
|
- |
|
|
# Create release payload
|
|
cat > release.json <<EOF
|
|
{
|
|
"tag_name": "${DRONE_TAG}",
|
|
"target_commitish": "main",
|
|
"name": "PicPeak ${DRONE_TAG}",
|
|
"body": "# PicPeak ${DRONE_TAG}\n\n## 🐳 Docker Images\n\nThis release includes Docker images published to GitHub Container Registry:\n\n\`\`\`bash\n# Backend\ndocker pull ghcr.io/the-luap/picpeak-backend:${DRONE_TAG}\ndocker pull ghcr.io/the-luap/picpeak-backend:latest\n\n# Frontend\ndocker pull ghcr.io/the-luap/picpeak-frontend:${DRONE_TAG}\ndocker pull ghcr.io/the-luap/picpeak-frontend:latest\n\`\`\`\n\n## 📦 What's New\n\nSee the [README](https://github.com/the-luap/picpeak#readme) for features and documentation.\n\n## 🚀 Quick Start\n\n\`\`\`bash\n# Clone and deploy\ngit clone https://github.com/the-luap/picpeak.git\ncd picpeak\n\n# Use the tagged version\ndocker-compose -f docker-compose.prod.yml up -d\n\`\`\`\n\n---\n\nFor detailed deployment instructions, see the [Deployment Guide](https://github.com/the-luap/picpeak/blob/main/DEPLOYMENT.md).",
|
|
"draft": false,
|
|
"prerelease": false
|
|
}
|
|
EOF
|
|
- |
|
|
# Create the release on GitHub
|
|
curl -X POST \
|
|
-H "Accept: application/vnd.github+json" \
|
|
-H "Authorization: Bearer $GITHUB_TOKEN" \
|
|
-H "X-GitHub-Api-Version: 2022-11-28" \
|
|
https://api.github.com/repos/the-luap/picpeak/releases \
|
|
-d @release.json
|
|
|
|
trigger:
|
|
event:
|
|
- tag |