-
Notifications
You must be signed in to change notification settings - Fork 9
62 lines (56 loc) · 1.87 KB
/
deploy-review-app.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Deploy Review App
concurrency: deploy_${{ github.ref_name }}
on:
workflow_dispatch:
inputs:
environment:
description: Environment to deploy to
required: true
type: choice
options:
- review
pr-number:
description: PR number for the existing review app to deploy to
required: false
sha:
description: Commit sha of an existing build image to be deployed
required: true
jobs:
deploy-review-app:
name: Deployment To Review
concurrency: deploy_review_${{ inputs.pr-number }}
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Start review-${{ inputs.pr-number }} Deployment
uses: bobheadxi/deployments@v1
id: deployment
with:
step: start
token: ${{ secrets.GITHUB_TOKEN }}
env: review-${{ inputs.pr-number }}
ref: ${{ github.head_ref }}
- name: Checkout
uses: actions/checkout@v4
- name: Deploy App to Review
id: deploy_review
uses: ./.github/actions/deploy/
with:
azure-credentials: ${{ secrets.AZURE_CREDENTIALS_REVIEW }}
environment: review
pr-number: ${{ inputs.pr-number }}
sha: ${{ inputs.sha }}
slack-webhook: ${{ secrets.SLACK_WEBHOOK }}
prod-credentials: ${{ secrets.AZURE_CREDENTIALS_PRODUCTION }}
- name: Update review-${{ inputs.pr-number }} status
if: always()
uses: bobheadxi/deployments@v1
with:
step: finish
token: ${{ secrets.GITHUB_TOKEN }}
env: review-${{ inputs.pr-number }}
status: ${{ job.status }}
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
env_url: ${{ steps.deploy_review.outputs.deploy-url }}
ref: ${{ github.head_ref }}