-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
100 additions
and
69 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,47 @@ | ||
# reusable template for running Elastic Beanstalk deployments to AWS accounts | ||
name: aws-deploy | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
aws-region: | ||
type: string | ||
default: us-east-1 | ||
role-to-assume: | ||
required: true | ||
type: string | ||
role-duration-seconds: | ||
type: number | ||
default: 1800 | ||
ebcli-command: | ||
type: string | ||
required: true | ||
|
||
jobs: | ||
deploy: | ||
permissions: | ||
id-token: write | ||
contents: read | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'corretto' | ||
java-version: '17' | ||
cache: 'maven' | ||
- name: Build with Maven | ||
run: mvn clean package | ||
- name: Assume AWS Role | ||
uses: aws-actions/configure-aws-credentials@v2 | ||
with: | ||
aws-region: ${{ inputs.aws-region }} | ||
role-to-assume: ${{ inputs.role-to-assume }} | ||
role-session-name: GHA-${{ github.repository_owner }}-${{ github.event.repository.name }}-${{ github.run_id }} | ||
role-duration-seconds: ${{ inputs.role-duration-seconds }} | ||
# Install EB CLI from pypi instead of https://github.com/aws/aws-elastic-beanstalk-cli-setup | ||
# due to issue https://github.com/aws/aws-elastic-beanstalk-cli-setup/issues/148 | ||
- name: Install EB CLI | ||
run: pip install PyYAML==5.3.1 awsebcli | ||
- name: Deploy to Beanstalk | ||
run: ${{ inputs.ebcli-command }} |
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,50 @@ | ||
name: main | ||
|
||
on: | ||
pull_request: | ||
branches: ['*'] | ||
push: | ||
branches: ['*'] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'corretto' | ||
java-version: '17' | ||
cache: 'maven' | ||
- name: Build with Maven | ||
run: mvn clean package | ||
|
||
# Deploy with EB CLI using work around https://stackoverflow.com/a/53364728 | ||
deploy-scipooldev: | ||
if: github.ref == 'refs/heads/develop' | ||
needs: [test] | ||
uses: "./.github/workflows/aws-deploy.yaml" | ||
with: | ||
role-to-assume: "arn:aws:iam::465877038949:role/sagebase-github-oidc-scipool-dev-synapse-login-aws-infra" | ||
ebcli-command: "eb deploy --region us-east-1 --verbose --staged --timeout 30 synapse-login-scipooldev" | ||
deploy-scipoolprod: | ||
if: github.ref == 'refs/heads/prod' | ||
needs: [test] | ||
uses: "./.github/workflows/aws-deploy.yaml" | ||
with: | ||
role-to-assume: "arn:aws:iam::237179673806:role/sagebase-github-oidc-scipool-prod-synapse-login-aws-infra" | ||
ebcli-command: "eb deploy --region us-east-1 --verbose --staged --timeout 30 synapse-login-scipoolprod" | ||
deploy-bmgfki: | ||
if: github.ref == 'refs/heads/prod' | ||
needs: [test] | ||
uses: "./.github/workflows/aws-deploy.yaml" | ||
with: | ||
role-to-assume: "arn:aws:iam::464102568320:role/sagebase-github-oidc-scipool-prod-synapse-login-aws-infra" | ||
ebcli-command: "eb deploy --region us-east-1 --verbose --staged --timeout 30 synapse-login-bmgfki" | ||
deploy-strides: | ||
if: github.ref == 'refs/heads/prod' | ||
needs: [test] | ||
uses: "./.github/workflows/aws-deploy.yaml" | ||
with: | ||
role-to-assume: "arn:aws:iam::423819316185:role/github-oidc-sage-bionetworks" | ||
ebcli-command: "eb deploy --region us-east-1 --verbose --staged --timeout 30 synapse-login-strides" |
This file was deleted.
Oops, something went wrong.
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