Submit social housing lettings and sales data (CORE)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

68 lines
2.1 KiB

name: Review app pipeline
concurrency:
group: review-${{ inputs.pull_request_id }}
on:
workflow_dispatch:
inputs:
pull_request_id:
required: true
type: string
description: "The pull request ID to deploy a review app for."
defaults:
run:
shell: bash
jobs:
infra:
name: Deploy review app infrastructure
uses: communitiesuk/submit-social-housing-lettings-and-sales-data-infrastructure/.github/workflows/create_review_app_infra.yml@main
with:
key: ${{ inputs.pull_request_id }}
app_repo_role: arn:aws:iam::815624722760:role/core-application-repo
permissions:
id-token: write
code:
name: Deploy review app code
needs: [infra]
uses: ./.github/workflows/aws_deploy.yml
with:
aws_account_id: 837698168072
aws_role_prefix: core-dev
aws_task_prefix: core-review-${{ inputs.pull_request_id }}
concurrency_tag: ${{ inputs.pull_request_id }}
environment: review
permissions:
id-token: write
comment:
name: Add link to PR
needs: [code]
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Comment on PR with URL
uses: actions/github-script@v7
with:
script: |
const pullRequestId = ${{ inputs.pull_request_id }};
const body = `Created review app at https://review.submit-social-housing-data.communities.gov.uk/${pullRequestId}. 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: pullRequestId,
});
const duplicate = comments.find(c => c.body.startsWith('Created review app at'));
if (!duplicate) {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: pullRequestId,
body: body,
});
}