-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add github workflows and PR template
- Loading branch information
Showing
3 changed files
with
199 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
_Add ticket reference to Pull Request title: e.g. 'FS-123: Add content', if there is no ticket prefix with BAU_ | ||
|
||
|
||
### Change description | ||
_A brief description of the pull request_ | ||
|
||
- [ ] Unit tests and other appropriate tests added or updated | ||
- [ ] README and other documentation has been updated / added (if needed) | ||
- [ ] Commit messages are meaningful and follow good commit message guidelines (e.g. "FS-XXXX: Add margin to nav items preventing overlapping of logo") | ||
|
||
|
||
### How to test | ||
_If manual testing is needed, give suggested testing steps_ | ||
|
||
|
||
### Screenshots of UI changes (if applicable) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "pip" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
pull-request-branch-name: | ||
separator: "-" | ||
rebase-strategy: "auto" | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
pull-request-branch-name: | ||
separator: "-" | ||
rebase-strategy: "auto" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,167 @@ | ||
name: Deploy to AWS | ||
run-name: ${{ github.event_name == 'workflow_dispatch' && format('Deploy to {0}', github.event.inputs.environment) || (github.ref == 'refs/heads/main' && 'Deploy to Test-UAT-Prod' || 'Build & Unit Test') }} | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
environment: | ||
description: Which AWS Account to use | ||
type: choice | ||
required: true | ||
options: | ||
- dev | ||
- test | ||
- uat | ||
- prod | ||
run_performance_tests: | ||
required: false | ||
default: true | ||
type: boolean | ||
description: Run performance tests | ||
run_e2e_tests_assessment: | ||
required: false | ||
default: true | ||
type: boolean | ||
description: Run e2e tests (assessment) | ||
run_e2e_tests_application: | ||
required: false | ||
default: true | ||
type: boolean | ||
description: Run e2e tests (application) | ||
push: | ||
# Ignore README markdown | ||
# Only automatically deploy when something in the app or tests folder has changed | ||
paths: | ||
- '!**/README.md' | ||
- 'api/**' | ||
- 'config/**' | ||
- 'scripts/**' | ||
- 'openapi/**' | ||
- 'db/**' | ||
- 'tests/**' | ||
- 'requirements-dev.in' | ||
- 'requirements-dev.txt' | ||
- 'requirements.in' | ||
- 'requirements.txt' | ||
- '.github/workflows/copilot_deploy.yml' | ||
|
||
jobs: | ||
setup: | ||
uses: communitiesuk/funding-service-design-workflows/.github/workflows/determine-jobs.yml@main | ||
with: | ||
environment: ${{ inputs.environment }} | ||
|
||
pre_deploy_tests: | ||
uses: communitiesuk/funding-service-design-workflows/.github/workflows/pre-deploy.yml@main | ||
with: | ||
# Note - no db-name, so defaults to postgres_db | ||
postgres_unit_testing: true | ||
|
||
paketo_build: | ||
needs: [ setup ] | ||
concurrency: build-pre-award-stores-pack | ||
permissions: | ||
packages: write | ||
uses: communitiesuk/funding-service-design-workflows/.github/workflows/package.yml@main | ||
with: | ||
version_to_build: sha-${{ github.sha }} | ||
owner: ${{ github.repository_owner }} | ||
application: funding-service-pre-award-stores | ||
|
||
dev_deploy: | ||
needs: [ pre_deploy_tests, paketo_build, setup ] | ||
if: ${{ contains(fromJSON(needs.setup.outputs.jobs_to_run), 'dev') }} | ||
uses: communitiesuk/funding-service-design-workflows/.github/workflows/standard-deploy.yml@main | ||
secrets: | ||
AWS_ACCOUNT: ${{ secrets.AWS_ACCOUNT }} | ||
with: | ||
environment: dev | ||
app_name: pre-award-stores | ||
version: sha-${{ github.sha }} | ||
db_name: pre_award_stores | ||
|
||
post_dev_deploy_tests: | ||
needs: dev_deploy | ||
concurrency: | ||
group: 'fsd-preaward-dev' | ||
cancel-in-progress: false | ||
secrets: | ||
FSD_GH_APP_ID: ${{ secrets.FSD_GH_APP_ID }} | ||
FSD_GH_APP_KEY: ${{ secrets.FSD_GH_APP_KEY }} | ||
uses: communitiesuk/funding-service-design-workflows/.github/workflows/post-deploy.yml@main | ||
with: | ||
run_performance_tests: ${{ inputs.run_performance_tests || true }} | ||
run_e2e_tests_assessment: ${{ inputs.run_e2e_tests_assessment || false }} | ||
run_e2e_tests_application: ${{ inputs.run_e2e_tests_application || false }} | ||
environment: dev | ||
app_name: pre-award-stores | ||
|
||
test_deploy: | ||
needs: [ dev_deploy, post_dev_deploy_tests, paketo_build, setup ] | ||
if: ${{ always() && contains(fromJSON(needs.setup.outputs.jobs_to_run), 'test') && (! contains(needs.*.result, 'failure') ) && (! contains(needs.*.result, 'cancelled') )}} | ||
uses: communitiesuk/funding-service-design-workflows/.github/workflows/standard-deploy.yml@main | ||
secrets: | ||
AWS_ACCOUNT: ${{ secrets.AWS_ACCOUNT }} | ||
with: | ||
environment: test | ||
app_name: pre-award-stores | ||
version: sha-${{ github.sha }} | ||
db_name: pre_award_stores | ||
|
||
post_test_deploy_tests: | ||
needs: [ dev_deploy, post_dev_deploy_tests, test_deploy, paketo_build, setup ] | ||
if: ${{ always() && contains(fromJSON(needs.setup.outputs.jobs_to_run), 'test') && (! contains(needs.*.result, 'failure') ) && (! contains(needs.*.result, 'cancelled') )}} | ||
concurrency: | ||
group: 'fsd-preaward-test' | ||
cancel-in-progress: false | ||
secrets: | ||
FSD_GH_APP_ID: ${{ secrets.FSD_GH_APP_ID }} | ||
FSD_GH_APP_KEY: ${{ secrets.FSD_GH_APP_KEY }} | ||
uses: communitiesuk/funding-service-design-workflows/.github/workflows/post-deploy.yml@main | ||
with: | ||
run_performance_tests: ${{ inputs.run_performance_tests || false }} | ||
run_e2e_tests_assessment: ${{ inputs.run_e2e_tests_assessment || true }} | ||
run_e2e_tests_application: ${{ inputs.run_e2e_tests_application || true }} | ||
environment: test | ||
app_name: pre-award-stores | ||
|
||
uat_deploy: | ||
needs: [ dev_deploy, post_dev_deploy_tests, test_deploy, post_test_deploy_tests, paketo_build, setup ] | ||
if: ${{ always() && contains(fromJSON(needs.setup.outputs.jobs_to_run), 'uat') && (! contains(needs.*.result, 'failure') ) && (! contains(needs.*.result, 'cancelled') )}} | ||
uses: communitiesuk/funding-service-design-workflows/.github/workflows/standard-deploy.yml@main | ||
secrets: | ||
AWS_ACCOUNT: ${{ secrets.AWS_ACCOUNT }} | ||
with: | ||
environment: uat | ||
app_name: pre-award-stores | ||
version: sha-${{ github.sha }} | ||
db_name: pre_award_stores | ||
|
||
post_uat_deploy_tests: | ||
needs: [ dev_deploy, post_dev_deploy_tests, test_deploy, post_test_deploy_tests, uat_deploy, paketo_build, setup ] | ||
if: ${{ always() && contains(fromJSON(needs.setup.outputs.jobs_to_run), 'uat') && (! contains(needs.*.result, 'failure') ) && (! contains(needs.*.result, 'cancelled') )}} | ||
concurrency: | ||
group: 'fsd-preaward-uat' | ||
cancel-in-progress: false | ||
secrets: | ||
FSD_GH_APP_ID: ${{ secrets.FSD_GH_APP_ID }} | ||
FSD_GH_APP_KEY: ${{ secrets.FSD_GH_APP_KEY }} | ||
uses: communitiesuk/funding-service-design-workflows/.github/workflows/post-deploy.yml@main | ||
with: | ||
run_performance_tests: ${{ inputs.run_performance_tests || false }} | ||
run_e2e_tests_assessment: ${{ inputs.run_e2e_tests_assessment || true }} | ||
run_e2e_tests_application: ${{ inputs.run_e2e_tests_application || true }} | ||
environment: uat | ||
app_name: pre-award-stores | ||
|
||
prod_deploy: | ||
needs: [ dev_deploy, post_dev_deploy_tests, test_deploy, post_test_deploy_tests, uat_deploy, post_uat_deploy_tests, paketo_build, setup ] | ||
if: ${{ always() && contains(fromJSON(needs.setup.outputs.jobs_to_run), 'prod') && (! contains(needs.*.result, 'failure') ) && (! contains(needs.*.result, 'cancelled') )}} | ||
uses: communitiesuk/funding-service-design-workflows/.github/workflows/standard-deploy.yml@main | ||
secrets: | ||
AWS_ACCOUNT: ${{ secrets.AWS_ACCOUNT }} | ||
with: | ||
environment: prod | ||
app_name: pre-award-stores | ||
version: sha-${{ github.sha }} | ||
db_name: pre_award_stores |