Skip to content

Commit

Permalink
update deployment status on deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
jiikko committed Apr 23, 2023
1 parent 5b16fd1 commit 1d7b0d5
Showing 1 changed file with 30 additions and 7 deletions.
37 changes: 30 additions & 7 deletions .github/workflows/deploy_to_production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,17 @@ env:
REPOSITORY_NAME: pbm-cloud

jobs:
create_deployment:
runs-on: ubuntu-latest
steps:
- uses: chrnorm/deployment-action@v2
name: Create GitHub deployment
id: deployment
with:
token: '${{ github.token }}'
environment-url: https://pbm-cloud-dev.jiikko.com/
environment: production

build:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -76,7 +87,7 @@ jobs:
--allow-unauthenticated
publish:
needs: deploy
needs: [build, deploy]
runs-on: ubuntu-latest
steps:
- name: Add SHORT_SHA env property with commit short sha
Expand All @@ -98,10 +109,22 @@ jobs:
--to-tags="master-${SHORT_SHA}=100" \
--region="asia-northeast1"
- uses: chrnorm/deployment-action@v2
name: Create GitHub deployment
id: deployment
update_deployment_status:
needs: [build, deploy, publish]
if: always()
runs-on: ubuntu-latest
steps:
- name: Update deployment status (failure)
if: failure()
uses: chrnorm/deployment-status@v2
with:
token: '${{ github.token }}'
environment-url: https://pbm-cloud-dev.jiikko.com/
environment: production
token: ${{ github.token }}
state: 'failure'
deployment-id: ${{ steps.deployment.outputs.deployment_id }}
- name: Update deployment status (success)
if: success()
uses: chrnorm/deployment-status@v2
with:
token: ${{ github.token }}
state: 'success'
deployment-id: ${{ steps.deployment.outputs.deployment_id }}

0 comments on commit 1d7b0d5

Please sign in to comment.