Skip to content

Commit e380fa7

Browse files
committed
create github deployment during release
1 parent 81632f1 commit e380fa7

File tree

3 files changed

+38
-1
lines changed

3 files changed

+38
-1
lines changed

.github/workflows/release-production.yml

+2
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,6 @@ jobs:
1111
with:
1212
version: ${{ inputs.version }}
1313
dest-file: index.html
14+
environment: production
15+
url: https://collaborative-learning.concord.org
1416
secrets: inherit

.github/workflows/release-staging.yml

+2
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,6 @@ jobs:
1111
with:
1212
version: ${{ inputs.version }}
1313
dest-file: staging.html
14+
environment: staging
15+
url: https://collaborative-learning.concord.org/staging.html
1416
secrets: inherit

.github/workflows/release.yml

+34-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ on:
1010
type: string
1111
description: The released file name for each index-top that is copied
1212
required: true
13+
environment:
14+
type: string
15+
description: GitHub environment to send the deployment to
16+
required: true
17+
url:
18+
type: string
19+
description: URL to use for environment-url and log-url
20+
required: true
1321
env:
1422
BUCKET: models-resources
1523
PREFIX: collaborative-learning
@@ -22,6 +30,14 @@ jobs:
2230
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
2331
AWS_DEFAULT_REGION: us-east-1
2432
steps:
33+
- uses: chrnorm/deployment-action@v2
34+
name: Create GitHub deployment
35+
id: deployment
36+
with:
37+
token: '${{ github.token }}'
38+
environment-url: ${{ inputs.url }}
39+
environment: ${{ inputs.environment }}
40+
ref: ${{ inputs.version }}
2541
- run: >
2642
aws s3 cp
2743
s3://${{ env.BUCKET }}/${{ env.PREFIX }}/version/${{ inputs.version }}/${{ env.SRC_FILE }}
@@ -30,4 +46,21 @@ jobs:
3046
aws s3 cp
3147
s3://${{ env.BUCKET }}/${{ env.PREFIX }}/version/${{ inputs.version }}/editor/${{ env.SRC_FILE }}
3248
s3://${{ env.BUCKET }}/${{ env.PREFIX }}/editor/${{ inputs.dest-file }}
33-
49+
- name: Update deployment status (success)
50+
if: success()
51+
uses: chrnorm/deployment-status@v2
52+
with:
53+
token: '${{ github.token }}'
54+
environment-url: ${{ inputs.url }}
55+
log-url: ${{ inputs.url }}
56+
state: 'success'
57+
deployment-id: ${{ steps.deployment.outputs.deployment_id }}
58+
- name: Update deployment status (failure)
59+
if: failure()
60+
uses: chrnorm/deployment-status@v2
61+
with:
62+
token: '${{ github.token }}'
63+
environment-url: ${{ inputs.url }}
64+
log-url: ${{ inputs.url }}
65+
state: 'failure'
66+
deployment-id: ${{ steps.deployment.outputs.deployment_id }}

0 commit comments

Comments
 (0)