Skip to content

Merge pull request #47 from PowerSupply-ES/feature-admin-problem #9

Merge pull request #47 from PowerSupply-ES/feature-admin-problem

Merge pull request #47 from PowerSupply-ES/feature-admin-problem #9

Workflow file for this run

name: Continuos Deployment
on:
push:
branches: [ "main", "dev" ]
env:
PROJECT_NAME: pes
BUCKET_NAME: pes-was-deploy
CODE_DEPLOY_APP_NAME: code-deploy-was
DEPLOYMENT_GROUP_NAME: code-deploy-group-was
jobs:
deploy:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'temurin'
- name: Grant execute permission for gradlew
run: chmod +x ./gradlew
shell: bash
- name: Build and Test
run: ./gradlew build test
- name: Make Zip File
run: zip -qq -r ./$GITHUB_SHA.zip .
shell: bash
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_PRIVATE_ACCESS_KEY }}
aws-region: ap-northeast-2
- name: Upload to S3
run: aws s3 cp --region ap-northeast-2 ./$GITHUB_SHA.zip s3://$BUCKET_NAME/$GITHUB_SHA.zip
- name: Code Deploy To EC2 instance
run: aws deploy create-deployment
--application-name $CODE_DEPLOY_APP_NAME
--deployment-config-name CodeDeployDefault.AllAtOnce
--deployment-group-name $DEPLOYMENT_GROUP_NAME
--s3-location bucket=$BUCKET_NAME,bundleType=zip,key=$GITHUB_SHA.zip