Skip to content

Commit

Permalink
Revert "fix: github actions 수정"
Browse files Browse the repository at this point in the history
This reverts commit 140d2f4.
  • Loading branch information
ay-eonii committed Nov 18, 2023
1 parent 1d2ce9e commit e719b51
Showing 1 changed file with 11 additions and 23 deletions.
34 changes: 11 additions & 23 deletions .github/workflows/leets-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:

env:
AWS_REGION: ap-northeast-2
AWS_S3_BUCKET: gitactionbucket
AWS_CODE_DEPLOY_APPLICATION: cicd-test-cd
AWS_CODE_DEPLOY_GROUP: cicd-test-cd-group
RESOURCE_PATH: ./src/main/resources/application.yml

jobs:
Expand Down Expand Up @@ -53,30 +56,15 @@ jobs:

- name: gradlew에 실행 권한 부여
run: chmod +x ./gradlew

- name: 프로젝트 빌드
run: ./gradlew clean build -x test

- name: DockerHub 로그인
uses: docker/login-action@v1
- name: AWS credential 설정
uses: aws-actions/configure-aws-credentials@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Docker image Build 및 Push
run: |
docker build -t ${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_REPO }} .
docker push ${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_REPO }}
aws-region: ${{ env.AWS_REGION }}
aws-access-key-id: ${{ secrets.CICD_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.CICD_SECRET_KEY }}
- name: S3에 업로드
run: aws deploy push --application-name ${{ env.AWS_CODE_DEPLOY_APPLICATION }} --ignore-hidden-files --s3-location s3://$AWS_S3_BUCKET/cicdtest/$GITHUB_SHA.zip --source .
- name: EC2에 배포
uses: appleboy/ssh-action@master
id: deploy
with:
host: ${{ secrets.HOST }}
username: ec2-user
key: ${{ secrets.KEY }}
envs: GITHUB_SHA
script: |
sudo docker rm -f $(docker ps -qa)
sudo docker pull ${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_REPO }}-dev
docker image prune -f
run: aws deploy create-deployment --application-name ${{ env.AWS_CODE_DEPLOY_APPLICATION }} --deployment-config-name CodeDeployDefault.AllAtOnce --deployment-group-name ${{ env.AWS_CODE_DEPLOY_GROUP }} --s3-location bucket=$AWS_S3_BUCKET,key=cicdtest/$GITHUB_SHA.zip,bundleType=zip

0 comments on commit e719b51

Please sign in to comment.