# 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: maxvojtkov/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"