submodule ์ ์ฉ #5
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: ๊ฐ๋ฐ ์๋ฒ ๋ฐฐํฌ ํ ์คํธ all | |
on: | |
push: | |
branches: | |
- test/github-actions | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
submodules: 'true' | |
token: '${{ github.token }}' | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: '17' | |
- name: Cache Gradle packages | |
uses: actions/cache@v3 | |
with: | |
path: ~/.gradle/caches | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} | |
restore-keys: ${{ runner.os }}-gradle | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Build Spring Boot application | |
run: ./gradlew clean build --no-daemon -Pprofile=develop | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.DEVELOP_AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.DEVELOP_AWS_SECRET_ACCESS_KEY }} | |
aws-region: ap-northeast-2 | |
- name: Upload S3 | |
run: aws deploy push | |
--application-name TaxiMate-develop | |
--ignore-hidden-files | |
--s3-location s3://taxi-mate-develop-bucket/archive/$GITHUB_SHA.zip | |
--source . | |
- name: Deploy EC2 | |
run: aws deploy create-deployment | |
--application-name TaxiMate-develop | |
--deployment-config-name CodeDeployDefault.AllAtOnce | |
--deployment-group-name TaxiMate-develop-deployment-group | |
--s3-location bucket=taxi-mate-develop-bucket,key=archive/$GITHUB_SHA.zip,bundleType=zip |