-
Notifications
You must be signed in to change notification settings - Fork 2
[NDR-266] Split jobs on sandbox #446
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 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
7eb854b
init
jameslinnell fdf8192
Set branch and main terraform build to separate jobs
jameslinnell 4fd20f8
Update job names
jameslinnell 9a45247
Add 8 character limit to sandbox name
jameslinnell 1af93aa
Move branch check to job level.
jameslinnell e73f2ba
Fix terraform version
jameslinnell 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 | ||||
|---|---|---|---|---|---|---|
|
|
@@ -10,7 +10,7 @@ on: | |||||
| required: true | ||||||
| type: "string" | ||||||
| sandbox_name: | ||||||
| description: "Sandbox name [a-z0-9]{1,9}" | ||||||
| description: "Sandbox name [a-z0-9]{1,8}" | ||||||
| required: true | ||||||
| type: "string" | ||||||
|
|
||||||
|
|
@@ -20,20 +20,26 @@ permissions: | |||||
| contents: read # This is required for actions/checkout | ||||||
|
|
||||||
| jobs: | ||||||
| terraform_process: | ||||||
| validate_inputs: | ||||||
| runs-on: ubuntu-latest | ||||||
| environment: development | ||||||
|
|
||||||
| steps: | ||||||
| - name: Validate inputs | ||||||
| run: | | ||||||
| if ! [[ "$SANDBOX_NAME" =~ ^[a-z0-9]{1,9}$ ]]; then | ||||||
| echo "Sandbox name must match [a-z0-9]{1,9} (lowercase letters and digits only, 1-9 chars)." | ||||||
| if ! [[ "$SANDBOX_NAME" =~ ^[a-z0-9]{1,8}$ ]]; then | ||||||
| echo "Sandbox name must match [a-z0-9]{1,8} (lowercase letters and digits only, 1-8 chars)." | ||||||
| exit 1 | ||||||
| fi | ||||||
| env: | ||||||
| SANDBOX_NAME: ${{ github.event.inputs.sandbox_name }} | ||||||
|
|
||||||
| terraform_process--main: | ||||||
| runs-on: ubuntu-latest | ||||||
| needs: validate_inputs | ||||||
| environment: development | ||||||
|
|
||||||
| steps: | ||||||
| # Checkout the repository to the GitHub Actions runner | ||||||
| - name: Checkout main | ||||||
| uses: actions/checkout@v5 | ||||||
|
|
@@ -81,41 +87,59 @@ jobs: | |||||
| run: terraform apply -auto-approve -input=false tf-main.plan | ||||||
| working-directory: ./infrastructure | ||||||
|
|
||||||
| terraform_process--branch: | ||||||
| if: ${{ github.event.inputs.git_ref != 'main' }} | ||||||
| runs-on: ubuntu-latest | ||||||
| needs: terraform_process--main | ||||||
| environment: development | ||||||
|
|
||||||
| steps: | ||||||
| - name: Configure AWS Credentials | ||||||
| uses: aws-actions/configure-aws-credentials@v5 | ||||||
| with: | ||||||
| role-to-assume: ${{ secrets.AWS_ASSUME_ROLE }} | ||||||
| role-skip-session-tagging: true | ||||||
| aws-region: ${{ vars.AWS_REGION }} | ||||||
| mask-aws-account-id: true | ||||||
|
|
||||||
| - name: View AWS Role | ||||||
| run: aws sts get-caller-identity | ||||||
|
|
||||||
| - name: Setup Terraform | ||||||
| uses: hashicorp/setup-terraform@v3 | ||||||
| with: | ||||||
| terraform_version: 1.11.4 | ||||||
|
||||||
| terraform_version: 1.11.4 | |
| terraform_version: 1.13.3 |
jameslinnell marked this conversation as resolved.
Show resolved
Hide resolved
jameslinnell marked this conversation as resolved.
Show resolved
Hide resolved
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.
Uh oh!
There was an error while loading. Please reload this page.