Merge pull request #45 from Team-Plu/fix/#44 #20
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 is a basic workflow to help you get started with Actions | |
name: notification-deploy-dev | |
# Controls when the workflow will run | |
on: | |
push: | |
branches: [ develop ] | |
paths: | |
- .github/workflows/** | |
- plu-notification/** | |
- plu-common/** | |
- plu-domain/** | |
- plu-external/** | |
env: | |
AWS_S3_BUCKET: plu-s3 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
# μν¬νλ‘μ° μ€ν μ κΈ°λ³Έμ μΌλ‘ 체ν¬μμ νμ | |
- name: Checkout | |
uses: actions/checkout@v3 | |
# Firebase secret νμΌ μμ± | |
- name: create secret files | |
working-directory: plu-notification/src/main/resources | |
run: | | |
touch application.yml | |
touch application-dev.yml | |
echo "${{ secrets.NOTIFICATION_YML }}" > application.yml | |
echo "${{ secrets.NOTIFICATION_DEV_YML }}" > application-dev.yml | |
mkdir firebase | |
touch ./firebase/plu-firebase-config.json | |
echo "${{ secrets.FIREBASE_SERVICE_KEY_JSON }}" > ./firebase/plu-firebase-config.json | |
sed -i 's/#/"/g' ./firebase/plu-firebase-config.json | |
# JDK 11λ²μ | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'corretto' | |
java-version: '17' | |
# build | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
shell: bash | |
# - name: Test with Gradle | |
# run: ./gradlew test | |
- name: Build with Gradle | |
run: ./gradlew plu-notification:bootJar -x test | |
shell: bash | |
- name: Make zip file | |
run: zip -r ./notification-code-deploy2.zip ./plu-notification/build/libs/*.jar ./scripts/plu-notification/* -j | |
shell: bash | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_DEV }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY_DEV }} | |
aws-region: ap-northeast-2 | |
- name: Upload to S3 | |
run: aws s3 cp --region ap-northeast-2 ./notification-code-deploy2.zip s3://$AWS_S3_BUCKET/notification-code-deploy2.zip | |
- name: Code Deploy | |
run: aws deploy create-deployment | |
--application-name plu-application | |
--deployment-config-name CodeDeployDefault.OneAtATime | |
--deployment-group-name NOTIFICATION | |
--s3-location bucket=$AWS_S3_BUCKET,bundleType=zip,key=notification-code-deploy2.zip |