-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from aodn/5320_refactored_ci_cd
5320 refactored ci cd
- Loading branch information
Showing
77 changed files
with
193 additions
and
185 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,6 @@ | ||
AWS_REGION=ap-southeast-2 | ||
AWS_ROLE_ARN=arn:aws:iam::851725428481:role/AodnGitHubActionsRole | ||
CODEARTIFACT_DOMAIN=central-aodn-org-au | ||
CODEARTIFACT_REPO=maven-aodn-store | ||
ECR_REGISTRY=851725428481.dkr.ecr.ap-southeast-2.amazonaws.com | ||
ECR_REPOSITORY=geonetwork4 |
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,2 @@ | ||
AWS_REGION=ap-southeast-2 | ||
AWS_ROLE_ARN=arn:aws:iam::704910415367:role/AodnGitHubActionsRole |
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 |
---|---|---|
@@ -1,5 +1,2 @@ | ||
AWS_REGION=ap-southeast-2 | ||
CODEARTIFACT_DOMAIN=gamma-aodn-org-au | ||
CODEARTIFACT_REPO=maven-aodn-store | ||
ECR_REGISTRY=450356697252.dkr.ecr.ap-southeast-2.amazonaws.com | ||
ECR_REPOSITORY=geonetwork4 | ||
AWS_ROLE_ARN=arn:aws:iam::211125304466:role/AodnGitHubActionsRole |
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 |
---|---|---|
@@ -1,5 +1,2 @@ | ||
AWS_REGION=ap-southeast-2 | ||
CODEARTIFACT_DOMAIN=gamma-aodn-org-au | ||
CODEARTIFACT_REPO=maven-aodn-store | ||
ECR_REGISTRY=450356697252.dkr.ecr.ap-southeast-2.amazonaws.com | ||
ECR_REPOSITORY=geonetwork4 | ||
AWS_ROLE_ARN=arn:aws:iam::905418367757:role/AodnGitHubActionsRole |
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
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 |
---|---|---|
|
@@ -2,8 +2,6 @@ name: Run Pre-commit Checks | |
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
permissions: | ||
id-token: write | ||
|
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
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
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,86 @@ | ||
name: Trigger Deploy | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
app_name: | ||
required: true | ||
description: The short-name of the app corresponding to the folder in appdeploy. | ||
type: string | ||
environment: | ||
required: true | ||
description: The environment to use for the deploy job. | ||
type: choice | ||
options: | ||
- edge | ||
- staging | ||
- production | ||
digest: | ||
required: false | ||
description: The image digest to pass to the deploy job. | ||
type: string | ||
workflow_call: | ||
inputs: | ||
app_name: | ||
required: true | ||
type: string | ||
digest: | ||
required: false | ||
type: string | ||
environment: | ||
required: true | ||
type: string | ||
|
||
permissions: | ||
id-token: write | ||
contents: read | ||
|
||
jobs: | ||
trigger_deploy: | ||
runs-on: ubuntu-latest | ||
environment: ${{ inputs.environment }} | ||
steps: | ||
- name: Configure AWS Credentials | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
audience: sts.amazonaws.com | ||
aws-region: ${{ vars.AWS_REGION }} | ||
role-to-assume: ${{ vars.AWS_ROLE_ARN }} | ||
|
||
- name: Push Image Digest to SSM | ||
if: ${{ inputs.digest != '' }} | ||
run: | | ||
aws ssm put-parameter \ | ||
--name "/apps/${{ inputs.app_name }}/${{ inputs.environment }}/image_digest" \ | ||
--type "String" \ | ||
--value "$digest" \ | ||
--overwrite | ||
env: | ||
digest: ${{ inputs.digest }} | ||
|
||
- name: Generate App Token | ||
uses: actions/create-github-app-token@v1 | ||
id: app-token | ||
with: | ||
app-id: ${{ vars.DEPLOY_APP_ID }} | ||
private-key: ${{ secrets.DEPLOY_APP_PRIVATE_KEY }} | ||
owner: ${{ github.repository_owner }} | ||
repositories: "appdeploy" | ||
|
||
- name: Trigger Deploy Workflow | ||
uses: actions/github-script@v7 | ||
with: | ||
github-token: ${{ steps.app-token.outputs.token }} | ||
retries: 3 | ||
retry-exempt-status-codes: 204 | ||
script: | | ||
github.rest.actions.createWorkflowDispatch({ | ||
owner: 'aodn', | ||
repo: 'appdeploy', | ||
workflow_id: 'deploy.yml', | ||
ref: 'main', | ||
inputs: { | ||
app_name: '${{ inputs.app_name }}', | ||
environment: '${{ inputs.environment }}' | ||
} | ||
}) |
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
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
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
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
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
Oops, something went wrong.