{"id":13469586,"url":"https://github.com/bobheadxi/deployments","last_synced_at":"2025-04-08T12:06:50.385Z","repository":{"id":36900066,"uuid":"218437679","full_name":"bobheadxi/deployments","owner":"bobheadxi","description":"🔖 GitHub Action for working painlessly with deployment statuses","archived":false,"fork":false,"pushed_at":"2024-03-26T17:45:50.000Z","size":32070,"stargazers_count":388,"open_issues_count":12,"forks_count":63,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-03T04:04:00.589Z","etag":null,"topics":["deployments","github-actions","github-api","status"],"latest_commit_sha":null,"homepage":"https://github.com/marketplace/actions/github-deployments","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bobheadxi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-30T03:40:50.000Z","updated_at":"2025-03-03T23:30:33.000Z","dependencies_parsed_at":"2024-03-26T05:24:02.048Z","dependency_job_id":"9de8a69a-dea4-4512-b337-e3ce2da98487","html_url":"https://github.com/bobheadxi/deployments","commit_stats":{"total_commits":93,"total_committers":20,"mean_commits":4.65,"dds":0.5913978494623655,"last_synced_commit":"5626e5f5bdc792fc764cc3c439cf6044c6c983f1"},"previous_names":[],"tags_count":25,"template":false,"template_full_name":"actions/typescript-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bobheadxi%2Fdeployments","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bobheadxi%2Fdeployments/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bobheadxi%2Fdeployments/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bobheadxi%2Fdeployments/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bobheadxi","download_url":"https://codeload.github.com/bobheadxi/deployments/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247838443,"owners_count":21004580,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deployments","github-actions","github-api","status"],"created_at":"2024-07-31T15:01:46.000Z","updated_at":"2025-04-08T12:06:50.355Z","avatar_url":"https://github.com/bobheadxi.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# GitHub Deployments [![View Action](https://img.shields.io/badge/view-github%20action-yellow.svg)](https://bobheadxi.dev/r/deployments/) [![pipeline](https://github.com/bobheadxi/deployments/actions/workflows/pipeline.yaml/badge.svg)](https://github.com/bobheadxi/deployments/actions/workflows/pipeline.yaml)\n\n`bobheadxi/deployments` is a [GitHub Action](https://github.com/features/actions) for working painlessly with [GitHub deployment statuses](https://docs.github.com/en/rest/reference/deployments).\nInstead of exposing convoluted Action configuration that mirrors that of the [GitHub API](https://developer.github.com/v3/repos/deployments/) like some of the other available Actions do, this Action simply exposes a number of configurable, easy-to-use \"steps\" common to most deployment lifecycles.\n\n\u003e 📢 This project is in need of additional maintainers - if you are interested in helping out please [let me know](https://github.com/bobheadxi/deployments/discussions/103)!\n\n- [Configuration](#configuration)\n  - [`step: start`](#step-start)\n  - [`step: finish`](#step-finish)\n  - [`step: deactivate-env`](#step-deactivate-env)\n  - [`step: delete-env`](#step-delete-env)\n- [Debugging](#debugging)\n- [Migrating to v1](#migrating-to-v1)\n\nA simple example:\n\n```yml\non:\n  push:\n    branches:\n    - main\n\njobs:\n  deploy:\n    runs-on: ubuntu-latest\n    steps:\n    - name: start deployment\n      uses: bobheadxi/deployments@v1\n      id: deployment\n      with:\n        step: start\n        token: ${{ secrets.GITHUB_TOKEN }}\n        env: release\n\n    - name: do my deploy\n      # ...\n\n    - name: update deployment status\n      uses: bobheadxi/deployments@v1\n      if: always()\n      with:\n        step: finish\n        token: ${{ secrets.GITHUB_TOKEN }}\n        status: ${{ job.status }}\n        env: ${{ steps.deployment.outputs.env }}\n        deployment_id: ${{ steps.deployment.outputs.deployment_id }}\n```\n\nYou can also refer to other projects that also use this action - you can find [more usages of this action on Sourcegraph](https://sourcegraph.com/search?q=context:global+uses:+bobheadxi/deployments%40.*+file:%5E%5C.github/workflows+-repo:bobheadxi+count:all\u0026patternType=regexp), or check out the following examples:\n\n- [`github/super-linter`](https://sourcegraph.com/search?q=context:global+repo:%5Egithub%5C.com/github/super-linter%24+file:%5E%5C.github/workflows+bobheadxi/deployments\u0026patternType=literal) [![GitHub Repo stars](https://img.shields.io/github/stars/github/super-linter?style=social)](https://github.com/github/super-linter) - [GitHub's all-in-one linter Action](https://github.blog/2020-06-18-introducing-github-super-linter-one-linter-to-rule-them-all/)\n- [`mxcl/PromiseKit`](https://sourcegraph.com/search?q=context:global+repo:%5Egithub%5C.com/mxcl/PromiseKit%24+file:%5E%5C.github/workflows+bobheadxi/deployments\u0026patternType=literal) [![GitHub Repo stars](https://img.shields.io/github/stars/mxcl/PromiseKit?style=social)](https://github.com/mxcl/PromiseKit) - promises for Swift and Objective-C\n- [`saleor/saleor`](https://sourcegraph.com/search?q=repo:%5Egithub%5C.com/saleor/saleor%24+bobheadxi/deployments\\\u0026patternType=literal) [![GitHub Repo stars](https://img.shields.io/github/stars/saleor/saleor?style=social)](https://github.com/saleor/saleor) - modular, high performance, headless e-commerce storefront\n- [`sharetribe/sharetribe`](https://sourcegraph.com/search?q=context:global+repo:%5Egithub%5C.com/sharetribe/sharetribe%24+file:%5E%5C.github/workflows+bobheadxi/deployments\u0026patternType=literal) [![GitHub Repo stars](https://img.shields.io/github/stars/sharetribe/sharetribe?style=social)](https://github.com/sharetribe/sharetribe) - marketplace software\n- [`skylines-project/skylines`](https://sourcegraph.com/search?q=repo:%5Egithub%5C.com/skylines-project/skylines%24+bobheadxi/deployments\\\u0026patternType=literal) [![GitHub Repo stars](https://img.shields.io/github/stars/skylines-project/skylines?style=social)](https://github.com/skylines-project/skylines) - live tracking, flight database and competition web platform\n\nAlso feel free to chime in on the [show and tell discussion](https://github.com/bobheadxi/deployments/discussions/84) to share your usages of this Action!\n\nCheck out [this blog post](https://dev.to/bobheadxi/branch-previews-with-google-app-engine-and-github-actions-3pco) for a bit of background on the origins of this project.\n\n## Configuration\n\nThe following [`inputs`](https://help.github.com/en/articles/workflow-syntax-for-github-actions#jobsjob_idstepswith) configuration options are for *all steps*:\n\n| Variable     | Default                      | Purpose                                                                                                                                |\n| ------------ | ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |\n| `step`       |                              | One of [`start`](#step-start), [`finish`](#step-finish), [`deactivate-env`](#step-deactivate-env), or [`delete-env`](#step-delete-env) |\n| `token`      | `${{ github.token }}`          | provide your `${{ github.token }}` or `${{ secrets.GITHUB_TOKEN }}` for API access                                                                              |\n| `env`        |                              | identifier for environment to deploy to (e.g. `staging`, `prod`, `main`)                                                               |\n| `repository` | Current repository           | target a specific repository for updates, e.g. `owner/repo`                                                                            |\n| `logs`       | URL to GitHub commit checks  | URL of your deployment logs                                                                                                            |\n| `desc`       | GitHub-generated description | description for this deployment                                                                                                        |\n| `ref`        | `github.ref`                 | Specify a particular git ref to use,  (e.g. `${{ github.head_ref }}`)                                                                  |\n\n### `step: start`\n\nThis is best used on the `push: { branches: [ ... ] }` event, but you can also have `release: { types: [ published ] }` trigger this event.\n`start` should be followed by whatever deployment tasks you want to do, and it creates and marks a deployment as \"started\":\n\n![deploy started](.static/start.png)\n\nIn addition to the [core configuration](#configuration), the following [`inputs`](https://help.github.com/en/articles/workflow-syntax-for-github-actions#jobsjob_idstepswith) are available:\n\n| Variable        | Default    | Purpose                                                                                             |\n| --------------- | -------    | --------------------------------------------------------------------------------------------------- |\n| `deployment_id` |            | Use an existing deployment instead of creating a new one (e.g. `${{ github.event.deployment.id }}`) |\n| `override`      | `false`    | whether to mark existing deployments of this environment as inactive                                |\n| `payload`       |            | JSON-formatted dictionary with extra information about the deployment                               |\n| `task`          | `'deploy'` | change the task associated with this deployment, can be any string\n\n\nThe following [`outputs`](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/contexts-and-expression-syntax-for-github-actions#steps-context) are available:\n\n| Variable        | Purpose                                |\n| --------------- | -------------------------------------- |\n| `deployment_id` | ID of created GitHub deployment        |\n| `status_id`     | ID of created GitHub deployment status |\n| `env`           | name of configured environment         |\n\n\u003cdetails\u003e\n\u003csummary\u003eSimple Push Example\u003c/summary\u003e\n\u003cp\u003e\n\n```yml\non:\n  push:\n    branches:\n    - main\n\njobs:\n  deploy:\n    steps:\n    - name: start deployment\n      uses: bobheadxi/deployments@v1\n      id: deployment\n      with:\n        step: start\n        env: release\n\n    - name: do my deploy\n      # ...\n```\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n\u003cbr /\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eSimple Pull Request Example\u003c/summary\u003e\n\u003cp\u003e\n\n```yml\non:\n  pull_request:\n\njobs:\n  deploy:\n    runs-on: ubuntu-latest\n    steps:\n    - name: start deployment\n      uses: bobheadxi/deployments@v1\n      id: deployment\n      with:\n        step: start\n        env: integration\n\n    - name: do my deploy\n      # ...\n```\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n\u003cbr /\u003e\n\n### `step: finish`\n\nThis is best used after `step: start` and should follow whatever deployment tasks you want to do in the same workflow.\n`finish` marks an in-progress deployment as complete:\n\n![deploy finished](.static/finish.png)\n\nIn addition to the [core configuration](#configuration), the following [`inputs`](https://help.github.com/en/articles/workflow-syntax-for-github-actions#jobsjob_idstepswith) are available:\n\n| Variable        | Default | Purpose                                                                                                                                                                                                             |\n| --------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `status`        |         | provide the current deployment job status `${{ job.status }}`                                                                                                                                                       |\n| `deployment_id` |         | identifier for deployment to update (see outputs of [`step: start`](#step-start))                                                                                                                                   |\n| `env_url`       |         | URL to view deployed environment                                                                                                                                                                                    |\n| `override`      | `true`  | whether to manually mark existing deployments of this environment as inactive                                                                                                                                       |\n| `auto_inactive` | `false` | whether to let GitHub handle marking existing deployments of this environment as inactive ([if and only if a new deployment succeeds](https://docs.github.com/en/rest/reference/deployments#inactive-deployments)). |\n\n\u003cdetails\u003e\n\u003csummary\u003eSimple Example\u003c/summary\u003e\n\u003cp\u003e\n\n```yml\n# ...\n\njobs:\n  deploy:\n    steps:\n    - name: start deployment\n      # ... see previous example\n\n    - name: do my deploy\n      # ...\n\n    - name: update deployment status\n      uses: bobheadxi/deployments@v1\n      if: always()\n      with:\n        step: finish\n        token: ${{ secrets.GITHUB_TOKEN }}\n        status: ${{ job.status }}\n        env: ${{ steps.deployment.outputs.env }}\n        deployment_id: ${{ steps.deployment.outputs.deployment_id }}\n```\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n\u003cbr /\u003e\n\n### `step: deactivate-env`\n\nThis is best used on the `pull_request: { types: [ closed ] }` event, since GitHub does not seem to provide a event to detect when branches are deleted.\nThis step can be used to automatically shut down deployments you create on pull requests and mark environments as destroyed:\n\n![env destroyed](.static/destroyed.png)\n\nRefer to the [core configuration](#configuration) for available [`inputs`](https://help.github.com/en/articles/workflow-syntax-for-github-actions#jobsjob_idstepswith).\n\n\u003cdetails\u003e\n\u003csummary\u003eSimple Example\u003c/summary\u003e\n\u003cp\u003e\n\n```yml\non:\n  pull_request:\n    types: [ closed ]\n\njobs:\n  prune:\n    steps:\n    # see https://dev.to/bobheadxi/branch-previews-with-google-app-engine-and-github-actions-3pco\n    - name: extract branch name\n      id: get_branch\n      shell: bash\n      env:\n        PR_HEAD: ${{ github.head_ref }}\n      run: echo \"##[set-output name=branch;]$(echo ${PR_HEAD#refs/heads/} | tr / -)\"\n\n    - name: do my deployment shutdown\n      # ...\n\n    - name: mark environment as deactivated\n      uses: bobheadxi/deployments@v1\n      with:\n        step: deactivate-env\n        token: ${{ secrets.GITHUB_TOKEN }}\n        env: ${{ steps.get_branch.outputs.branch }}\n        desc: Environment was pruned\n```\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n### `step: delete-env`\n\nThis is the same as `deactivate-env`, except deletes the environment entirely. See [`step: deactivate-env`](#step-deactivate-env) for more details.\n\nNote that the default `GITHUB_TOKEN` does not allow environment deletion - you have to set a personal access token with `deployments:write` and `administration:write` permissions and provide it in the `token` input.\n\nRefer to the [core configuration](#configuration) for available [`inputs`](https://help.github.com/en/articles/workflow-syntax-for-github-actions#jobsjob_idstepswith).\n\n\u003cbr /\u003e\n\n## Debugging\n\nThe argument `debug: true` can be provided to print arguments used by `deployments` and log debug information.\n\nIf you run into an problems or have any questions, feel free to open an [issue](https://github.com/bobheadxi/deployments/issues) or [discussion](https://github.com/bobheadxi/deployments/discussions)!\n\n\u003cbr /\u003e\n\n## Migrating to v1\n\n`bobheadxi/deployments@v1` makes the following breaking changes from `v0.6.x`:\n\n- **CHANGED: `no_override` is now `override`**, and the default behaviour is `override: true` in `step: finish` (`step: start` behaviour remains unchanged, but you can now set `override: true` on it now as well).\n- **CHANGED: `log_args` is now `debug`**, but does the same thing as before.\n- **CHANGED: `env` is now always required**. You can use `env: ${{ steps.deployment.outputs.env }}` to avoid repeating your env configuration.\n- **REMOVED: `transient`** - all deployments created by this action are `transient` by default, with removals handled by `override`, `auto_inactive`, or `step: deactivate-env`.\n- **ADDED: `step: delete-env`** deletes an environment entirely.\n\nThen you can change your workflow to target the `v1` tag, and automatically receive updates going forward:\n\n```diff\n- uses: bobheadxi/deployments@v0.6.2\n+ uses: bobheadxi/deployments@v1\n```\n\n## Migrating to v1.2.0\n\nThe `token` configuration variable now has a default value so if you are happy with the default (`${{ github.secret }}`) you can simplify the action configuration by removing this from your actions.\n\n\u003cbr /\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbobheadxi%2Fdeployments","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbobheadxi%2Fdeployments","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbobheadxi%2Fdeployments/lists"}