|
4 | 4 | name: Sample App Deployment - Java S3 |
5 | 5 | on: |
6 | 6 | workflow_dispatch: # be able to run the workflow on demand |
| 7 | + push: |
7 | 8 |
|
8 | 9 | permissions: |
9 | 10 | id-token: write |
10 | 11 | contents: read |
11 | 12 |
|
12 | 13 | jobs: |
13 | | - upload-main-service-jar: |
| 14 | + build-main-service-jar: |
14 | 15 | strategy: |
15 | 16 | fail-fast: false |
16 | 17 | matrix: |
17 | | - aws-region: [ 'af-south-1','ap-east-1','ap-northeast-1','ap-northeast-2','ap-northeast-3','ap-south-1','ap-south-2','ap-southeast-1', |
18 | | - 'ap-southeast-2','ap-southeast-3','ap-southeast-4','ca-central-1','eu-central-1','eu-central-2','eu-north-1', |
19 | | - 'eu-south-1','eu-south-2','eu-west-1','eu-west-2','eu-west-3','il-central-1','me-central-1','me-south-1', 'sa-east-1', |
20 | | - 'us-east-1','us-east-2', 'us-west-1', 'us-west-2' ] |
| 18 | + java-version: [ '17' ] |
21 | 19 | runs-on: ubuntu-latest |
22 | 20 | steps: |
23 | 21 | - uses: actions/checkout@v4 |
24 | 22 | with: |
25 | 23 | fetch-depth: 0 |
26 | 24 |
|
27 | | - - name: Configure AWS Credentials |
28 | | - uses: aws-actions/configure-aws-credentials@v4 |
29 | | - with: |
30 | | - role-to-assume: ${{ secrets.E2E_IAD_TEST_ACCOUNT_ARN }} |
31 | | - aws-region: us-east-1 |
32 | | - |
33 | | - - name: Retrieve account |
34 | | - uses: aws-actions/aws-secretsmanager-get-secrets@v1 |
35 | | - with: |
36 | | - secret-ids: |
37 | | - ACCOUNT_ID, region-account/${{ matrix.aws-region }} |
38 | | - |
39 | | - - name: Configure AWS Credentials |
40 | | - uses: aws-actions/configure-aws-credentials@v4 |
41 | | - with: |
42 | | - role-to-assume: arn:aws:iam::${{ env.ACCOUNT_ID }}:role/${{ secrets.E2E_TEST_ROLE_ARN }} |
43 | | - aws-region: ${{ matrix.aws-region }} |
44 | | - |
45 | 25 | - name: Build Main Jar |
46 | 26 | working-directory: sample-apps/springboot |
47 | | - run: gradle build |
48 | | - |
49 | | - - name: Upload to S3 |
50 | | - working-directory: sample-apps/springboot |
51 | | - run: aws s3api put-object --bucket ${{ secrets.APP_SIGNALS_E2E_EC2_JAR }}-prod-${{ matrix.aws-region }} --body ./build/libs/springboot-*-SNAPSHOT.jar --key main-service.jar |
52 | | - |
53 | | - upload-remote-service-jar: |
54 | | - strategy: |
55 | | - fail-fast: false |
56 | | - matrix: |
57 | | - aws-region: [ 'af-south-1','ap-east-1','ap-northeast-1','ap-northeast-2','ap-northeast-3','ap-south-1','ap-south-2','ap-southeast-1', |
58 | | - 'ap-southeast-2','ap-southeast-3','ap-southeast-4','ca-central-1','eu-central-1','eu-central-2','eu-north-1', |
59 | | - 'eu-south-1','eu-south-2','eu-west-1','eu-west-2','eu-west-3','il-central-1','me-central-1','me-south-1', 'sa-east-1', |
60 | | - 'us-east-1','us-east-2','us-west-1', 'us-west-2' ] |
61 | | - runs-on: ubuntu-latest |
62 | | - steps: |
63 | | - - uses: actions/checkout@v4 |
64 | | - with: |
65 | | - fetch-depth: 0 |
66 | | - |
67 | | - - name: Configure AWS Credentials |
68 | | - uses: aws-actions/configure-aws-credentials@v4 |
69 | | - with: |
70 | | - role-to-assume: ${{ secrets.E2E_IAD_TEST_ACCOUNT_ARN }} |
71 | | - aws-region: us-east-1 |
72 | | - |
73 | | - - name: Retrieve account |
74 | | - uses: aws-actions/aws-secretsmanager-get-secrets@v1 |
75 | | - with: |
76 | | - secret-ids: |
77 | | - ACCOUNT_ID, region-account/${{ matrix.aws-region }} |
78 | | - |
79 | | - - name: Configure AWS Credentials |
80 | | - uses: aws-actions/configure-aws-credentials@v4 |
81 | | - with: |
82 | | - role-to-assume: arn:aws:iam::${{ env.ACCOUNT_ID }}:role/${{ secrets.E2E_TEST_ROLE_ARN }} |
83 | | - aws-region: ${{ matrix.aws-region }} |
84 | | - |
85 | | - - name: Build Main Jar |
86 | | - working-directory: sample-apps/springboot-remote-service |
87 | | - run: gradle build |
| 27 | + run: gradle build -P javaVersion=${{ matrix.java-version }} |
88 | 28 |
|
89 | | - - name: Upload to S3 |
90 | | - working-directory: sample-apps/springboot-remote-service |
91 | | - run: aws s3api put-object --bucket ${{ secrets.APP_SIGNALS_E2E_EC2_JAR }}-prod-${{ matrix.aws-region }} --body build/libs/springboot-remote-service-*-SNAPSHOT.jar --key remote-service.jar |
| 29 | +# upload-main-service-jar: |
| 30 | +# strategy: |
| 31 | +# fail-fast: false |
| 32 | +# matrix: |
| 33 | +# aws-region: [ 'us-east-1' ] |
| 34 | +# runs-on: ubuntu-latest |
| 35 | +# steps: |
| 36 | +# - uses: actions/checkout@v4 |
| 37 | +# with: |
| 38 | +# fetch-depth: 0 |
| 39 | +# |
| 40 | +# - name: Configure AWS Credentials |
| 41 | +# uses: aws-actions/configure-aws-credentials@v4 |
| 42 | +# with: |
| 43 | +# role-to-assume: ${{ secrets.E2E_IAD_TEST_ACCOUNT_ARN }} |
| 44 | +# aws-region: us-east-1 |
| 45 | +# |
| 46 | +# - name: Retrieve account |
| 47 | +# uses: aws-actions/aws-secretsmanager-get-secrets@v1 |
| 48 | +# with: |
| 49 | +# secret-ids: |
| 50 | +# ACCOUNT_ID, region-account/${{ matrix.aws-region }} |
| 51 | +# |
| 52 | +# - name: Configure AWS Credentials |
| 53 | +# uses: aws-actions/configure-aws-credentials@v4 |
| 54 | +# with: |
| 55 | +# role-to-assume: arn:aws:iam::${{ env.ACCOUNT_ID }}:role/${{ secrets.E2E_TEST_ROLE_ARN }} |
| 56 | +# aws-region: ${{ matrix.aws-region }} |
| 57 | +# |
| 58 | +# - name: Build Main Jar |
| 59 | +# working-directory: sample-apps/springboot |
| 60 | +# run: gradle build |
| 61 | +# |
| 62 | +# - name: Upload to S3 |
| 63 | +# working-directory: sample-apps/springboot |
| 64 | +# run: aws s3api put-object --bucket ${{ secrets.APP_SIGNALS_E2E_EC2_JAR }}-prod-${{ matrix.aws-region }} --body ./build/libs/springboot-*-SNAPSHOT.jar --key main-service.jar |
| 65 | +# |
| 66 | +# upload-remote-service-jar: |
| 67 | +# strategy: |
| 68 | +# fail-fast: false |
| 69 | +# matrix: |
| 70 | +# aws-region: [ 'af-south-1','ap-east-1','ap-northeast-1','ap-northeast-2','ap-northeast-3','ap-south-1','ap-south-2','ap-southeast-1', |
| 71 | +# 'ap-southeast-2','ap-southeast-3','ap-southeast-4','ca-central-1','eu-central-1','eu-central-2','eu-north-1', |
| 72 | +# 'eu-south-1','eu-south-2','eu-west-1','eu-west-2','eu-west-3','il-central-1','me-central-1','me-south-1', 'sa-east-1', |
| 73 | +# 'us-east-1','us-east-2','us-west-1', 'us-west-2' ] |
| 74 | +# runs-on: ubuntu-latest |
| 75 | +# steps: |
| 76 | +# - uses: actions/checkout@v4 |
| 77 | +# with: |
| 78 | +# fetch-depth: 0 |
| 79 | +# |
| 80 | +# - name: Configure AWS Credentials |
| 81 | +# uses: aws-actions/configure-aws-credentials@v4 |
| 82 | +# with: |
| 83 | +# role-to-assume: ${{ secrets.E2E_IAD_TEST_ACCOUNT_ARN }} |
| 84 | +# aws-region: us-east-1 |
| 85 | +# |
| 86 | +# - name: Retrieve account |
| 87 | +# uses: aws-actions/aws-secretsmanager-get-secrets@v1 |
| 88 | +# with: |
| 89 | +# secret-ids: |
| 90 | +# ACCOUNT_ID, region-account/${{ matrix.aws-region }} |
| 91 | +# |
| 92 | +# - name: Configure AWS Credentials |
| 93 | +# uses: aws-actions/configure-aws-credentials@v4 |
| 94 | +# with: |
| 95 | +# role-to-assume: arn:aws:iam::${{ env.ACCOUNT_ID }}:role/${{ secrets.E2E_TEST_ROLE_ARN }} |
| 96 | +# aws-region: ${{ matrix.aws-region }} |
| 97 | +# |
| 98 | +# - name: Build Main Jar |
| 99 | +# working-directory: sample-apps/springboot-remote-service |
| 100 | +# run: gradle build |
| 101 | +# |
| 102 | +# - name: Upload to S3 |
| 103 | +# working-directory: sample-apps/springboot-remote-service |
| 104 | +# run: aws s3api put-object --bucket ${{ secrets.APP_SIGNALS_E2E_EC2_JAR }}-prod-${{ matrix.aws-region }} --body build/libs/springboot-remote-service-*-SNAPSHOT.jar --key remote-service.jar |
92 | 105 |
|
0 commit comments