Skip to content

Commit

Permalink
Merge branch 'main' of github.com:ministryofjustice/opg-incident-resp…
Browse files Browse the repository at this point in the history
…onse into DDLS-377
  • Loading branch information
jamesrwarren committed Oct 22, 2024
2 parents e1e5944 + 595c68f commit ca82fdf
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 3 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/_smoke.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: "[Smoke] Check Web Site Is Functional"

defaults:
run:
shell: bash

on:
workflow_call:
inputs:
url:
description: "URL to run the smoke test against"
required: true
type: string

jobs:
smoke:
runs-on: ubuntu-latest
steps:
- name: check site availability
id: smoke
env:
URL: ${{ inputs.url }}
run: |
curl -o /dev/null -s -w "%{http_code}" ${URL} | grep -q 200 || exit 1
13 changes: 11 additions & 2 deletions .github/workflows/workflow_path_to_live.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ jobs:
branch_name: ${{ needs.workflow_variables.outputs.parsed_branch }}

deploy_to_production_environment:
if: ${{ github.actor != 'dependabot[bot]' }}
name: Deploy to Production Environment
needs: [
workflow_variables,
Expand All @@ -64,10 +63,20 @@ jobs:
account_name: production
apply: true

smoke_test:
name: Check Website Availability
needs: [
workflow_variables,
deploy_to_production_environment
]
uses: ./.github/workflows/_smoke.yml
with:
url: https://incident.opg.service.justice.gov.uk/ht/

end_of_pr_workflow:
name: End of PR Workflow
runs-on: ubuntu-latest
needs: [workflow_variables,deploy_to_production_environment]
needs: [workflow_variables,smoke_test]
steps:
- name: End of PR Workflow
run: echo "${{ needs.workflow_variables.outputs.version_tag }} tested, built and deployed to Production"
13 changes: 12 additions & 1 deletion .github/workflows/workflow_pull_request_path.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,21 @@ jobs:
account_name: development
apply: true

smoke_test:
if: ${{ github.actor != 'dependabot[bot]' }}
name: Check Website Availability
needs: [
workflow_variables,
deploy_to_development_environment
]
uses: ./.github/workflows/_smoke.yml
with:
url: https://dev.incident.opg.service.justice.gov.uk/ht/

end_of_pr_workflow:
name: End of PR Workflow
runs-on: ubuntu-latest
needs: [workflow_variables,deploy_to_development_environment]
needs: [workflow_variables,smoke_test]
steps:
- name: End of PR Workflow
run: echo "${{ needs.workflow_variables.outputs.version_tag }} tested, built and deployed to Development"

0 comments on commit ca82fdf

Please sign in to comment.