Files
dokploy-deploy-action/examples/manual-promote.yml
Max Vojtkov c4a7cabcef
Some checks failed
test / test (20) (push) Successful in 1m55s
test / test (22) (push) Successful in 1m3s
test / misconfiguration (push) Successful in 16s
release / major-tag (push) Failing after 15m44s
Host the action on Gitea
Workflows move to .gitea/workflows, which Gitea prefers over
.github/workflows when both exist.

GitHub Actions can only resolve `uses:` against github.com, so the
README now spells out both forms: the full Gitea URL, and the
checkout-then-`uses: ./` fallback for a GitHub workflow that has no
mirror of this repository.
2026-08-09 12:37:09 +03:00

44 lines
1.4 KiB
YAML

# Promote an already-built image to an environment on demand, and roll back the
# same way. Nothing is rebuilt: the tag chosen here is one CI has already
# tested and pushed.
name: promote
on:
workflow_dispatch:
inputs:
environment:
description: Dokploy environment to deploy to
type: choice
options: [staging, production]
default: staging
tag:
description: Image tag to promote, e.g. a short commit SHA
required: true
jobs:
promote:
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}
steps:
- id: deploy
uses: https://gitea.coolify.vojtkov.dev/usr_unknown/dokploy-deploy-action@v1
with:
host: ${{ secrets.DOKPLOY_HOST }}
api-key: ${{ secrets.DOKPLOY_API_KEY }}
project: shop
service: api
environment: ${{ inputs.environment }}
docker-image: ghcr.io/acme/api:${{ inputs.tag }}
title: Promote ${{ inputs.tag }} to ${{ inputs.environment }}
# Print the build log either way, since a human is watching.
logs: always
timeout: 900
- name: Announce
if: always()
run: |
echo "deployment ${{ steps.deploy.outputs.deployment-id }}" \
"finished with status ${{ steps.deploy.outputs.status }}" \
"in ${{ steps.deploy.outputs.duration }}s"