Skip to content

Commit ec56218

Browse files
committed
chore: asg용 github-actions 추가
1 parent e8083b3 commit ec56218

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

.github/workflows/github-actions.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
name: CI/CD with Docker
1+
name: CI/CD with Docker & ASG
22

33
on:
44
push:
5-
branches: [ "deploy" ]
5+
branches: [ "stage" ]
66

77
jobs:
88
deploy:
@@ -50,16 +50,16 @@ jobs:
5050
push: true
5151
tags: ${{ secrets.DOCKER_REPO }}:latest
5252

53-
- name: Deploy to Server
54-
uses: appleboy/ssh-action@master
53+
- name: AWS credentials
54+
uses: aws-actions/configure-aws-credentials@v2
5555
with:
56-
host: ${{ secrets.HOST }}
57-
username: ${{ secrets.USERNAME }}
58-
key: ${{ secrets.KEY }}
59-
envs: GITHUB_SHA
60-
script: |
61-
echo "${{ secrets.DOCKER_COMPOSE }}" | sudo tee ./docker-compose.yml
62-
sudo docker ps -q | xargs -r sudo docker stop && sudo docker ps -aq | xargs -r sudo docker rm
63-
sudo docker compose -f ./docker-compose.yml down --rmi all
64-
sudo docker pull ${{ secrets.DOCKER_REPO}}:latest
65-
sudo docker compose -f ./docker-compose.yml up -d
56+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}
57+
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }}
58+
aws-region: ap-northeast-2
59+
60+
- name: Auto Scaling Group Refresh
61+
run: |
62+
aws autoscaling start-instance-refresh \
63+
--auto-scaling-group-name onlyone-buddkit-back-asg \
64+
--strategy "Rolling" \
65+
--preferences "MinHealthyPercentage=50"

0 commit comments

Comments
 (0)