|
10 | 10 | type: string
|
11 | 11 | description: The released file name for each index-top that is copied
|
12 | 12 | 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 |
13 | 21 | env:
|
14 | 22 | BUCKET: models-resources
|
15 | 23 | PREFIX: collaborative-learning
|
|
22 | 30 | AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
23 | 31 | AWS_DEFAULT_REGION: us-east-1
|
24 | 32 | 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 }} |
25 | 41 | - run: >
|
26 | 42 | aws s3 cp
|
27 | 43 | s3://${{ env.BUCKET }}/${{ env.PREFIX }}/version/${{ inputs.version }}/${{ env.SRC_FILE }}
|
|
30 | 46 | aws s3 cp
|
31 | 47 | s3://${{ env.BUCKET }}/${{ env.PREFIX }}/version/${{ inputs.version }}/editor/${{ env.SRC_FILE }}
|
32 | 48 | 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