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.
44 lines
1.4 KiB
YAML
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"
|