[LH-188] Fix wrong parameter name #57
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
name: cd | |
on: | |
push: | |
branches: | |
- develop | |
pull_request: | |
branches: | |
- develop | |
env: | |
BUCKET_NAME: lingoswap-build | |
ARN: arn:aws:iam::285279154236:role/s3-codedeploy | |
AWS_REGION: ap-northeast-2 | |
permissions: | |
id-token: write | |
contents: read | |
defaults: | |
run: | |
shell: bash | |
working-directory: . | |
jobs: | |
Deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
token: ${{secrets.ACCESS_TOKEN}} | |
submodules: true | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'semeru' | |
- name: Validate Gradle wrapper | |
uses: gradle/wrapper-validation-action@v1 | |
- name: Cache Gradle packages | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
- name: Change gradlew permissions | |
run: chmod +x ./gradlew | |
- name: Build with Gradle | |
run: ./gradlew bootJar | |
- name: Compress build files | |
run: | | |
zip -r -qq -j ./build.zip ./build/libs/*.jar ./appspec.yml ./execute-deploy.sh | |
- name: Configure aws credentials | |
uses: aws-actions/configure-aws-credentials@v2 | |
with: | |
role-to-assume: ${{ env.ARN }} | |
aws-region: ${{ env.AWS_REGION }} | |
- name: Upload to S3 | |
run: | | |
aws s3 cp ./build.zip s3://${{ env.BUCKET_NAME }}/ | |
- name: Code Deploy | |
run: aws deploy create-deployment --application-name lingoswap | |
--deployment-config-name CodeDeployDefault.OneAtATime | |
--deployment-group-name ec2 | |
--s3-location bucket=${{ env.BUCKET_NAME }},bundleType=zip,key=build.zip |