Skip to content

Commit acdb41b

Browse files
authored
JCL-376: Capture deployment metrics for releases (#507)
1 parent 7aabe91 commit acdb41b

1 file changed

Lines changed: 25 additions & 2 deletions

File tree

.github/workflows/cd-config.yml

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ jobs:
1313
deployment:
1414
name: Deploy artifacts
1515
runs-on: ubuntu-latest
16-
environment:
17-
name: ${{ matrix.envName }}
16+
permissions:
17+
deployments: write
1818
strategy:
1919
matrix:
2020
envName: ["Development", "Production"]
@@ -41,6 +41,13 @@ jobs:
4141
gpg-private-key: ${{ secrets.GPG_SIGNING_KEY }}
4242
gpg-passphrase: MAVEN_GPG_PASSPHRASE
4343

44+
- name: Create GitHub deployment
45+
uses: chrnorm/deployment-action@v2
46+
id: deployment
47+
with:
48+
token: ${{ github.token }}
49+
environment: ${{ matrix.envName }}
50+
4451
- name: Build the code with Maven
4552
run: mvn -B -ntp install -Pci
4653

@@ -52,6 +59,22 @@ jobs:
5259
MAVEN_REPO_TOKEN: ${{ secrets.SONATYPE_TOKEN }}
5360
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
5461

62+
- name: Update deployment status (success)
63+
if: success()
64+
uses: chrnorm/deployment-status@v2
65+
with:
66+
token: ${{ github.token }}
67+
state: 'success'
68+
deployment-id: ${{ steps.deployment.outputs.deployment_id }}
69+
70+
- name: Update deployment status (failure)
71+
if: failure()
72+
uses: chrnorm/deployment-status@v2
73+
with:
74+
token: ${{ github.token }}
75+
state: 'failure'
76+
deployment-id: ${{ steps.deployment.outputs.deployment_id }}
77+
5578
- name: Sonar Analysis
5679
if: ${{ github.actor != 'dependabot[bot]' }}
5780
run: mvn sonar:sonar -Dsonar.login=${{ secrets.SONARQUBE_TOKEN }}

0 commit comments

Comments
 (0)