Browse Source

Merge 6ea8fd7ad2 into 61eb52516d

pull/3238/merge
Nat Dean-Lewis 3 days ago committed by GitHub
parent
commit
0df71c9b0c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      .github/workflows/manual_review_code_pipeline.yml
  2. 1
      .github/workflows/production_pipeline.yml
  3. 23
      .github/workflows/review_app_hint.yml
  4. 30
      .github/workflows/review_pipeline.yml
  5. 3
      .github/workflows/review_teardown_pipeline.yml

2
.github/workflows/manual_review_code_pipeline.yml

@ -1,4 +1,4 @@
name: Manual review app code pipeline
name: "Review App: Manual Code Redeploy"
concurrency:
group: review-${{ inputs.review_app_key }}

1
.github/workflows/production_pipeline.yml

@ -3,7 +3,6 @@ name: Production CI/CD Pipeline
on:
release:
types: [released]
workflow_dispatch:
defaults:
run:

23
.github/workflows/review_app_hint.yml

@ -0,0 +1,23 @@
name: "Review App: PR Hint Comment"
on:
pull_request:
types: [opened]
jobs:
hint:
name: Add review app hint
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Comment on PR
uses: actions/github-script@v7
with:
script: |
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: 'To deploy a review app for this PR, add the `review-app` label.',
});

30
.github/workflows/review_pipeline.yml

@ -1,4 +1,4 @@
name: Review app pipeline
name: "Review App: Deploy"
concurrency:
group: review-${{ github.event.pull_request.number }}
@ -6,9 +6,9 @@ concurrency:
on:
pull_request:
types:
- opened
- synchronize
- reopened
- labeled
workflow_dispatch:
defaults:
@ -18,6 +18,7 @@ defaults:
jobs:
infra:
name: Deploy review app infrastructure
if: contains(github.event.pull_request.labels.*.name, 'review-app')
uses: communitiesuk/submit-social-housing-lettings-and-sales-data-infrastructure/.github/workflows/create_review_app_infra.yml@main
with:
key: ${{ github.event.pull_request.number }}
@ -27,6 +28,7 @@ jobs:
code:
name: Deploy review app code
if: contains(github.event.pull_request.labels.*.name, 'review-app')
needs: [infra]
uses: ./.github/workflows/aws_deploy.yml
with:
@ -40,6 +42,7 @@ jobs:
comment:
name: Add link to PR
if: contains(github.event.pull_request.labels.*.name, 'review-app')
needs: [code]
runs-on: ubuntu-latest
permissions:
@ -48,10 +51,21 @@ jobs:
steps:
- name: Comment on PR with URL
uses: unsplash/comment-on-pr@v1.3.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: actions/github-script@v7
with:
msg: "Created review app at https://review.submit-social-housing-data.communities.gov.uk/${{ github.event.pull_request.number }}. Note that the review app will be automatically deprovisioned after 30 days and will need the review app pipeline running again."
check_for_duplicate_msg: true
duplicate_msg_pattern: Created review app at*
script: |
const prNumber = context.issue.number;
const msg = `Created review app at https://review.submit-social-housing-data.communities.gov.uk/${prNumber}. Note that the review app will be automatically deprovisioned after 30 days and will need the review app pipeline running again.`;
const { data: comments } = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: prNumber,
});
if (!comments.find(c => c.body.startsWith('Created review app at'))) {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: prNumber,
body: msg,
});
}

3
.github/workflows/review_teardown_pipeline.yml

@ -1,4 +1,4 @@
name: Review app teardown pipeline
name: "Review App: Teardown"
concurrency:
group: review-${{ github.event.pull_request.number }}
@ -7,7 +7,6 @@ on:
pull_request:
types:
- closed
workflow_dispatch:
env:
app_repo_role: arn:aws:iam::815624722760:role/core-application-repo

Loading…
Cancel
Save