-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
6150075
commit ada985d
Showing
6 changed files
with
85 additions
and
5 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,78 @@ | ||
name: cd | ||
on: | ||
workflow_run: | ||
workflows: [ ci ] | ||
branches: | ||
- develop | ||
types: | ||
- completed | ||
|
||
env: | ||
BUCKET_NAME: lingoswap-dev-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: | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
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@v4 | ||
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-test | ||
--s3-location bucket=${{ env.BUCKET_NAME }},bundleType=zip,key=build.zip |
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 |
---|---|---|
|
@@ -3,7 +3,7 @@ on: | |
workflow_run: | ||
workflows: [ ci ] | ||
branches: | ||
- develop | ||
- main | ||
types: | ||
- completed | ||
|
||
|
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
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