-
Notifications
You must be signed in to change notification settings - Fork 1
[PRMP-1493] Add branch or tagged version deployments to pre-prod #530
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
| @@ -1,7 +1,13 @@ | ||
| name: "PRE PROD Full - Deploy and Version Main to Pre-Prod" | ||
| name: "PRE PROD Full - Deploy to Pre-Prod" | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| branch_or_tag: | ||
| description: "Which branch or tag do you want to deploy to pre-prod?" | ||
| required: true | ||
| type: string | ||
| default: main | ||
|
|
||
| permissions: | ||
| pull-requests: write | ||
|
|
@@ -12,8 +18,7 @@ jobs: | |
| view_action_parameters: | ||
| name: View input params | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
|
|
||
| steps: | ||
| - name: Display client passed variables | ||
| run: | | ||
| echo Build Branch: main | ||
|
|
@@ -52,17 +57,19 @@ jobs: | |
| needs: ["lambda_test_job", "react_testing_job", "cypress_test_job"] | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| tag: ${{steps.versioning.outputs.tag}} | ||
| new_tag: ${{steps.versioning.outputs.new_tag}} | ||
| version: ${{ steps.versioning.outputs.tag || github.event.inputs.branch_or_tag }} | ||
| permissions: write-all | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Checkout main | ||
| if: ${{ github.event.inputs.branch_or_tag == 'main' }} | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| ref: main | ||
| fetch-depth: '0' | ||
|
|
||
| - name: Bump version and push tag | ||
| if: ${{ github.event.inputs.branch_or_tag == 'main' }} | ||
| id: versioning | ||
| uses: anothrNick/[email protected] | ||
| env: | ||
|
|
@@ -72,15 +79,14 @@ jobs: | |
|
|
||
| - name: View outputs | ||
| run: | | ||
| echo Current tag: ${{steps.versioning.outputs.tag}} | ||
| echo New tag: ${{steps.versioning.outputs.new_tag}} | ||
| echo Deploying branch or tagged version to pre-prod: ${{ steps.versioning.outputs.tag || github.event.inputs.branch_or_tag }} | ||
|
|
||
| publish_all_lambda_layers: | ||
| name: Publish all Lambda Layers | ||
| needs: ["tag_and_release"] | ||
| uses: ./.github/workflows/base-lambda-layer-reusable-publish-all.yml | ||
| with: | ||
| build_branch: ${{ needs.tag_and_release.outputs.tag }} | ||
| build_branch: ${{ needs.tag_and_release.outputs.version }} | ||
| sandbox: pre-prod | ||
| environment: pre-prod | ||
| python_version: "3.11" | ||
|
|
@@ -92,7 +98,7 @@ jobs: | |
| needs: ["tag_and_release", "publish_all_lambda_layers"] | ||
| uses: ./.github/workflows/base-lambdas-reusable-deploy-all.yml | ||
| with: | ||
| build_branch: ${{ needs.tag_and_release.outputs.tag }} | ||
| build_branch: ${{ needs.tag_and_release.outputs.version }} | ||
| sandbox: pre-prod | ||
| environment: pre-prod | ||
| python_version: "3.11" | ||
|
|
@@ -104,7 +110,7 @@ jobs: | |
| needs: ["tag_and_release"] | ||
| uses: ./.github/workflows/base-deploy-ui.yml | ||
| with: | ||
| build_branch: ${{ needs.tag_and_release.outputs.tag }} | ||
| build_branch: ${{ needs.tag_and_release.outputs.version }} | ||
| environment: pre-prod | ||
| sandbox: pre-prod | ||
| secrets: | ||
|
|
@@ -115,12 +121,9 @@ jobs: | |
| needs: ["tag_and_release"] | ||
| uses: ./.github/workflows/base-batch-update.yml | ||
| with: | ||
| build_branch: ${{ needs.tag_and_release.outputs.tag }} | ||
| build_branch: ${{ needs.tag_and_release.outputs.version }} | ||
| environment: pre-prod | ||
| sandbox: pre-prod | ||
| secrets: | ||
| AWS_ASSUME_ROLE: ${{ secrets.AWS_ASSUME_ROLE }} | ||
|
|
||
|
|
||
|
|
||
|
|
||
This file contains hidden or 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 |
|---|---|---|
| @@ -1,7 +1,13 @@ | ||
| name: "PRE PROD Lambdas - Deploy and Version Main to Pre-Prod" | ||
| name: "PRE PROD Lambdas - Deploy to Pre-Prod" | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| branch_or_tag: | ||
| description: "Which branch or tag do you want to deploy to pre-prod?" | ||
| required: true | ||
| type: string | ||
| default: main | ||
|
|
||
| permissions: | ||
| pull-requests: write | ||
|
|
@@ -20,20 +26,22 @@ jobs: | |
| runs-on: ubuntu-latest | ||
| environment: pre-prod | ||
| outputs: | ||
| tag: ${{steps.versioning.outputs.tag}} | ||
| new_tag: ${{steps.versioning.outputs.new_tag}} | ||
| version: ${{ steps.versioning.outputs.tag || github.event.inputs.branch_or_tag }} | ||
| defaults: | ||
| run: | ||
| working-directory: ./lambdas | ||
| permissions: write-all | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Checkout main | ||
| if: ${{ github.event.inputs.branch_or_tag == 'main' }} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here |
||
| uses: actions/checkout@v4 | ||
| with: | ||
| ref: ${{ env.BUILD_BRANCH }} | ||
| ref: main | ||
| fetch-depth: '0' | ||
|
|
||
| - name: Bump version and push tag | ||
| if: ${{ github.event.inputs.branch_or_tag == 'main' }} | ||
| id: versioning | ||
| uses: anothrNick/[email protected] | ||
| env: | ||
|
|
@@ -43,20 +51,16 @@ jobs: | |
|
|
||
| - name: View outputs | ||
| run: | | ||
| echo Current tag: ${{steps.versioning.outputs.tag}} | ||
| echo New tag: ${{steps.versioning.outputs.new_tag}} | ||
| echo Deploying branch or tagged version to pre-prod lambdas: ${{ steps.versioning.outputs.tag || github.event.inputs.branch_or_tag }} | ||
|
|
||
| deploy_all: | ||
| name: Deploy all Lambdas | ||
| needs: ["run_tests", "tag_and_release"] | ||
| uses: ./.github/workflows/lambdas-deploy-feature-to-sandbox.yml | ||
| with: | ||
| build_branch: ${{ needs.tag_and_release.outputs.tag }} | ||
| build_branch: ${{ needs.tag_and_release.outputs.version }} | ||
| sandbox: pre-prod | ||
| environment: pre-prod | ||
| secrets: | ||
| AWS_ASSUME_ROLE: ${{ secrets.AWS_ASSUME_ROLE }} | ||
|
|
||
|
|
||
|
|
||
|
|
||
This file contains hidden or 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 |
|---|---|---|
| @@ -1,15 +1,20 @@ | ||
| name: 'PRE PROD UI - Deploy and Version Main to Pre-Prod' | ||
| name: 'PRE PROD UI - Deploy to Pre-Prod' | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| branch_or_tag: | ||
| description: "Which branch or tag do you want to deploy to pre-prod?" | ||
| required: true | ||
| type: string | ||
| default: main | ||
|
|
||
| permissions: | ||
| pull-requests: write | ||
| id-token: write # This is required for requesting the JWT | ||
| contents: read # This is required for actions/checkout | ||
|
|
||
| jobs: | ||
|
|
||
| react_testing_job: | ||
| name: Run UI Unit Tests | ||
| uses: ./.github/workflows/base-jest-test.yml | ||
|
|
@@ -31,20 +36,22 @@ jobs: | |
| build_branch: main | ||
|
|
||
| tag_and_release: | ||
| needs: ["lambda_test_job", "react_testing_job", "cypress_test_job"] | ||
| needs: ["react_testing_job", "cypress_test_job"] | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| tag: ${{steps.versioning.outputs.tag}} | ||
| new_tag: ${{steps.versioning.outputs.new_tag}} | ||
| version: ${{ steps.versioning.outputs.tag || github.event.inputs.branch_or_tag }} | ||
| permissions: write-all | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Checkout main | ||
| if: ${{ github.event.inputs.branch_or_tag == 'main' }} | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| ref: main | ||
| fetch-depth: '0' | ||
|
|
||
| - name: Bump version and push tag | ||
| if: ${{ github.event.inputs.branch_or_tag == 'main' }} | ||
| id: versioning | ||
| uses: anothrNick/[email protected] | ||
| env: | ||
|
|
@@ -54,16 +61,15 @@ jobs: | |
|
|
||
| - name: View outputs | ||
| run: | | ||
| echo Current tag: ${{steps.versioning.outputs.tag}} | ||
| echo New tag: ${{steps.versioning.outputs.new_tag}} | ||
| echo Deploying branch or tagged version to pre-prod UI: ${{ steps.versioning.outputs.tag || github.event.inputs.branch_or_tag }} | ||
|
|
||
| deploy_ui: | ||
| name: Deploy UI | ||
| needs: ["tag_and_release"] | ||
| uses: ./.github/workflows/base-deploy-ui.yml | ||
| with: | ||
| build_branch: ${{ needs.tag_and_release.outputs.tag }} | ||
| build_branch: ${{ needs.tag_and_release.outputs.version }} | ||
| environment: pre-prod | ||
| sandbox: pre-prod | ||
| secrets: | ||
| AWS_ASSUME_ROLE: ${{ secrets.AWS_ASSUME_ROLE }} | ||
| AWS_ASSUME_ROLE: ${{ secrets.AWS_ASSUME_ROLE }} | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move if to the
tag_and_releasejob