Merge pull request #311 from ministryofjustice/dependabot/npm_and_yar… #17
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "[Workflow] Path to Live" | |
concurrency: | |
group: pull-request-workflow | |
on: | |
push: | |
branches: | |
- main # match main | |
permissions: | |
id-token: write | |
contents: write | |
security-events: write | |
pull-requests: read | |
actions: none | |
checks: none | |
deployments: none | |
issues: none | |
packages: none | |
repository-projects: none | |
statuses: none | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
workflow_variables: | |
runs-on: ubuntu-latest | |
name: output workflow variables | |
outputs: | |
parsed_branch: main | |
version_tag: ${{ steps.semver_tag.outputs.created_tag }} | |
steps: | |
- uses: actions/checkout@cbb722410c2e876e24abbe8de2cc27693e501dcb # pin@v3 | |
- name: generate semver tag for release | |
id: semver_tag | |
uses: ministryofjustice/opg-github-actions/.github/actions/[email protected] | |
with: | |
prerelease: false | |
default_bump: "minor" | |
build_scan_push_containers: | |
name: Docker Build, Scan and Push | |
uses: ./.github/workflows/_build.yml | |
needs: [workflow_variables] | |
with: | |
tag: ${{ needs.workflow_variables.outputs.version_tag }} | |
branch_name: ${{ needs.workflow_variables.outputs.parsed_branch }} | |
deploy_to_production_environment: | |
name: Deploy to Production Environment | |
needs: [ | |
workflow_variables, | |
build_scan_push_containers | |
] | |
uses: ./.github/workflows/_deploy.yml | |
with: | |
workspace: production | |
image_tag: ${{ needs.workflow_variables.outputs.version_tag }} | |
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 workflow | |
runs-on: ubuntu-latest | |
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" |