Rendered by peptide-e2e/tools/gitea-pipeline/render.py from repos.json; calls the shared composite actions in peptide-e2e. Production deploy is gated by the PROD_DEPLOY_ENABLED org variable (cutover switch). .github/workflows unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AqpXh3hQMMaC74pTjFq4it
43 lines
1.6 KiB
YAML
43 lines
1.6 KiB
YAML
name: Rollback Deployment
|
|
|
|
# Gitea port of .github/workflows/rollback.yml. Redeploys a chosen commit to
|
|
# production through the same deploy composite action as a normal deploy (same
|
|
# rsync excludes, inventory guard and health check) instead of building an
|
|
# orphan `deploy` branch. Respects the PROD_DEPLOY_ENABLED kill switch.
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
commit_sha:
|
|
description: 'Commit SHA to deploy (leave empty for current main)'
|
|
required: false
|
|
default: ''
|
|
|
|
jobs:
|
|
rollback:
|
|
name: Roll production back to a commit
|
|
if: ${{ vars.PROD_DEPLOY_ENABLED == 'true' }}
|
|
runs-on: peptide-vps
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Check out target commit
|
|
shell: bash
|
|
env:
|
|
WANT: ${{ inputs.commit_sha }}
|
|
run: |
|
|
set -euo pipefail
|
|
T="${WANT:-$(git rev-parse HEAD)}"
|
|
case "$T" in *[!0-9a-fA-F]*) echo "::error::commit_sha must be hex"; exit 1 ;; esac
|
|
git cat-file -e "$T^{commit}" || { echo "::error::commit $T not found"; exit 1; }
|
|
git checkout -q --detach "$T"
|
|
echo "Rolling production back to $(git rev-parse --short HEAD): $(git log -1 --format=%s)"
|
|
- uses: https://git.protopeer.com/peptide-repo/peptide-e2e/.gitea/actions/deploy@main
|
|
with:
|
|
stage: production
|
|
target_path: wp-content/plugins/peptide-news-plugin
|
|
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}
|
|
ssh_host: ${{ secrets.SSH_HOST }}
|
|
ssh_port: ${{ secrets.SSH_PORT }}
|
|
ssh_username: ${{ secrets.SSH_USERNAME }}
|