https://github.com/sitkoru/github-deployment-action
Action to manage GitHub Deployments
https://github.com/sitkoru/github-deployment-action
Last synced: 8 months ago
JSON representation
Action to manage GitHub Deployments
- Host: GitHub
- URL: https://github.com/sitkoru/github-deployment-action
- Owner: sitkoru
- License: mit
- Created: 2022-01-27T05:35:13.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-09-04T17:18:22.000Z (almost 3 years ago)
- Last Synced: 2024-03-26T16:36:45.502Z (about 2 years ago)
- Language: JavaScript
- Size: 10.7 KB
- Stars: 0
- Watchers: 4
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# github-deployment-action
Action to manage GitHub Deployments
# Usage
## Create
```yml
name: Release
on:
release:
types:
- released
workflow_dispatch:
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Prepare
id: prep
shell: bash
run: |
VERSION=${GITHUB_REF#refs/tags/}
echo ::set-output name=version::${VERSION}
# some build actions
- uses: sitkoru/github-deployment-action@v1
name: Create GitHub deployment
with:
token: ${{ secrets.BOT_TOKEN }}
environment: production
ref: ${{ github.ref }}
version: ${{ steps.prep.outputs.version }}
```
## Change status
```yml
name: "Deploy"
on:
deployment:
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
# some deploy actions
- name: Update deployment status (success)
if: success()
uses: sitkoru/github-deployment-action@v1
with:
token: ${{ secrets.BOT_TOKEN }}
state: "success"
deployment_id: ${{ github.event.deployment.id }}
- name: Update deployment status (failure)
if: failure()
uses: sitkoru/github-deployment-action@v1
with:
token: ${{ secrets.BOT_TOKEN }}
state: "failure"
deployment_id: ${{ github.event.deployment.id }}
```