From 0d7d7870a72ad5ce3895e9005c3ac48ea4a29f08 Mon Sep 17 00:00:00 2001 From: Suraj Kumar Date: Sat, 31 Aug 2024 16:38:41 +0100 Subject: [PATCH] 1158: Add GitHub action to deploy JShell to AWS --- .github/workflows/deploy-jshell-aws.yaml | 44 ++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/deploy-jshell-aws.yaml diff --git a/.github/workflows/deploy-jshell-aws.yaml b/.github/workflows/deploy-jshell-aws.yaml new file mode 100644 index 0000000000..4e88489ba3 --- /dev/null +++ b/.github/workflows/deploy-jshell-aws.yaml @@ -0,0 +1,44 @@ +name: deploy +on: + push: + branches: [ master ] + paths: + - 'jshell-aws-backend/**' + workflow_dispatch: + +permissions: + id-token: write + contents: read + +jobs: + deploy: + name: Deploy to AWS + runs-on: ubuntu-latest + env: + AWS_REGION: eu-west-2 + steps: + - name: Check out code + uses: actions/checkout@v4 + + - name: Authenticate with AWS + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.GH_ACTIONS_ROLE_ARN }} + aws-region: ${{ env.AWS_REGION }} + + - name: Install SAM CLI + uses: aws-actions/setup-sam@v2 + with: + use-installer: true + + - name: Install Java + uses: actions/setup-java@v3 + with: + java-version: '21' + distribution: 'corretto' + + - name: Build Application + run: sam build -t infrastructure/template.yaml + + - name: Deploy to AWS + run: sam deploy --no-confirm-changeset --no-fail-on-empty-changeset --config-file infrastructure/samconfig.toml