Reusable workflow: prepare and start a deployment.
Purpose:
- Decide whether a deployment should start (comment trigger or other events).
- Resolve the target environment; supports dynamic environment names when
invoked from issue or pull-request events (e.g.
environment:issue_number). - Create a GitHub deployment and set its initial state to
in_progress.
Trigger:
- Can be triggered by a specific comment.
- Any event that triggers the workflow that's not an "issue_comment".
Environment:
- Support dynamic env when comming from issue or pull-request event
actions:readcontents:readdeployments:writeissues:writepull-requests:write
name: Deploy - Start
on:
push:
branches:
- main
permissions: {}
jobs:
deploy-start:
uses: hoverkraft-tech/ci-github-publish/.github/workflows/deploy-start.yml@91a69c7a9730d3ec2886a80681dbb67634c70970 # 0.23.1
permissions: {}
with:
# JSON array of runner(s) to use.
# See https://docs.github.com/en/actions/using-jobs/choosing-the-runner-for-a-job.
#
# Default: `["ubuntu-latest"]`
runs-on: '["ubuntu-latest"]'
# Environment where to deploy.
# If trigger is from an issue event (or pull-request), environment will be set to `environment:issue_number`.
# See https://docs.github.com/en/actions/deployment/deploying-to-your-cloud-provider/using-environments-for-deployment.
environment: ""
# Comment trigger to start the workflow.
# See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#issue_comment.
#
# Default: `/deploy`
trigger-on-comment: /deploy| Input | Description | Required | Type | Default |
|---|---|---|---|---|
runs-on |
JSON array of runner(s) to use. | false | string | ["ubuntu-latest"] |
| See https://docs.github.com/en/actions/using-jobs/choosing-the-runner-for-a-job. | ||||
environment |
Environment where to deploy. | false | string | - |
If trigger is from an issue event (or pull-request), environment will be set to environment:issue_number. |
||||
| See https://docs.github.com/en/actions/deployment/deploying-to-your-cloud-provider/using-environments-for-deployment. | ||||
trigger-on-comment |
Comment trigger to start the workflow. | false | string | /deploy |
| See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#issue_comment. |
| Output | Description |
|---|---|
trigger |
Trigger event that started the workflow. |
environment |
Environment where to deploy. |
deployment-id |
Deployment ID to use for the deployment. |
Contributions are welcome! Please see the contributing guidelines for more details.
This project is licensed under the MIT License.
SPDX-License-Identifier: MIT
Copyright © 2026 hoverkraft-tech
For more details, see the license.
This documentation was automatically generated by CI Dokumentor.