Skip to content

Commit

Permalink
fix:backcicd.yaml 변경된 시크릿에 맞게 코드 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
yoonseopkim committed Nov 11, 2024
1 parent ca09f35 commit 6a256b8
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion .github/workflows/backcicd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ jobs:
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ap-northeast-2

- name: Create env file
run: |
echo "${{ secrets.ENV }}" > .env
- name: Get EC2 instance ID
id: get-instance
run: |
Expand All @@ -112,9 +116,20 @@ jobs:
- name: Deploy to EC2 using SSM
run: |
# Source the environment variables
source .env
aws ssm start-session \
--target "${{ steps.get-instance.outputs.instance_id }}" \
--document-name "AWS-StartInteractiveCommand" \
--parameters '{
"command": ["sudo -i && docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_PASSWORD }} && docker pull aida0/gitfolio_${{ matrix.service_name }}:test && docker stop gitfolio_${{ matrix.service_name }} || true && docker rm gitfolio_${{ matrix.service_name }} || true && docker run -d --name gitfolio_${{ matrix.service_name }} -p ${{ matrix.port }}:8080 -e MEMBER_SERVER_URL=https://${MEMBER_PRIVATE_IP}:8081 -e AUTH_SERVER_URL=https://${AUTH_PRIVATE_IP}:8080 -e RESUME_SERVER_URL=https://${RESUME_PRIVATE_IP}:8082 -e PAYMENT_SERVER_URL=https://${PAYMENT_PRIVATE_IP}:8083 aida0/gitfolio_${{ matrix.service_name }}:test"]
"command": ["sudo -i && \
docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_PASSWORD }} && \
docker pull aida0/gitfolio_${{ matrix.service_name }}:test && \
docker stop gitfolio_${{ matrix.service_name }} || true && \
docker rm gitfolio_${{ matrix.service_name }} || true && \
docker run -d --name gitfolio_${{ matrix.service_name }} \
-p ${{ matrix.port }}:8080 \
--env-file .env \
aida0/gitfolio_${{ matrix.service_name }}:test"]
}'

0 comments on commit 6a256b8

Please sign in to comment.