Skip to content

Commit

Permalink
Merge branch 'develop' into prod
Browse files Browse the repository at this point in the history
  • Loading branch information
zaro0508 committed Oct 4, 2023
2 parents b37815c + a27940c commit 52cabe2
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 69 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/aws-deploy.yaml
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 }}
50 changes: 50 additions & 0 deletions .github/workflows/main.yaml
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"
62 changes: 0 additions & 62 deletions .travis.yml

This file was deleted.

6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ eb deploy synapse-login-scipooldev --profile my-aws --region us-east-1
```

## Continuous Integration
We have configured Travis CI to automatically build, test and deploy the application.
We have configured Github Action CI to automatically build, test and deploy the application.

## Contributions
Contributions are welcome
Expand All @@ -129,7 +129,3 @@ prod branch

## Issues
* https://sagebionetworks.jira.com/projects/SC

## Builds
* https://travis-ci.org/Sage-Bionetworks/synapse-login-scipoolprod

4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
<synapseVersion>388.0</synapseVersion>
<synapseVersion>446.0</synapseVersion>
</properties>

<repositories>
Expand Down Expand Up @@ -70,7 +70,7 @@
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20180813</version>
<version>20230227</version>
</dependency>

<!-- http://mvnrepository.com/artifact/commons-io/commons-io -->
Expand Down

0 comments on commit 52cabe2

Please sign in to comment.