-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #247 from prgrms-web-devcourse-final-project/feature/
#234-AI-prompt-추가 CI/CD 수정 -> Credential 삭제
- Loading branch information
Showing
2 changed files
with
1 addition
and
67 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,39 +50,6 @@ jobs: | |
artifact=$(ls ./build/libs/*.jar | head -n 1) | ||
echo "artifact=$artifact" >> $GITHUB_ENV | ||
# 9. SSH 키 설정 | ||
- name: Set up SSH | ||
uses: webfactory/[email protected] | ||
with: | ||
ssh-private-key: ${{ secrets.EC2_SSH_KEY }} | ||
# GitHub Secrets에 저장된 EC2 SSH 개인 키를 SSH 에이전트에 로드 | ||
|
||
# 10. GCP Credentials 디코딩 및 EC2로 전송 | ||
- name: Decode GCP Credentials | ||
run: echo "${{ secrets.GCP_CREDENTIALS }}" | base64 --decode > gcp-key.json | ||
# GitHub Secrets에 저장된 Base64 인코딩된 GCP JSON Key를 디코딩하여 로컬에 저장 | ||
|
||
- name: Copy GCP Credentials to EC2 | ||
run: scp -o StrictHostKeyChecking=no gcp-key.json ${{ secrets.EC2_USER }}@${{ secrets.EC2_IP }}:/home/${{ secrets.EC2_USER }}/gcp-key.json | ||
# 디코딩된 GCP JSON Key 파일을 EC2 서버로 전송 | ||
# YOUR_EC2_IP -> GitHub Secrets에 저장된 EC2 IP 주소 (${ secrets.EC2_IP }) | ||
# ec2-user -> GitHub Secrets에 저장된 EC2 SSH 사용자 이름 (${ secrets.EC2_USER }) | ||
|
||
# 11. EC2에서 GCP Credentials 설정 | ||
- name: Set up GCP Credentials on EC2 | ||
run: | | ||
ssh -o StrictHostKeyChecking=no ${{ secrets.EC2_USER }}@${{ secrets.EC2_IP }} << 'EOF' | ||
mkdir -p ~/.gcp | ||
mv /home/${{ secrets.EC2_USER }}/gcp-key.json ~/.gcp/key.json | ||
chmod 600 ~/.gcp/key.json | ||
export GOOGLE_APPLICATION_CREDENTIALS=~/.gcp/key.json | ||
# 환경 변수 설정을 영구적으로 추가 | ||
echo 'export GOOGLE_APPLICATION_CREDENTIALS=~/.gcp/key.json' >> ~/.bash_profile | ||
EOF | ||
# EC2 서버에서 GCP Credentials 설정 | ||
# YOUR_EC2_IP -> GitHub Secrets에 저장된 EC2 IP 주소 (${ secrets.EC2_IP }) | ||
# ec2-user -> GitHub Secrets에 저장된 EC2 SSH 사용자 이름 (${ secrets.EC2_USER }) | ||
|
||
# 빈스토크 배포 | ||
- name: Deploy to Elastic Beanstalk | ||
uses: einaregilsson/beanstalk-deploy@v20 | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,40 +53,7 @@ jobs: | |
artifact=$(ls ./build/libs/*.jar | head -n 1) | ||
echo "artifact=$artifact" >> $GITHUB_ENV | ||
# 9. SSH 키 설정 | ||
- name: Set up SSH | ||
uses: webfactory/[email protected] | ||
with: | ||
ssh-private-key: ${{ secrets.EC2_SSH_KEY_TWO }} | ||
# GitHub Secrets에 저장된 EC2 SSH 개인 키를 SSH 에이전트에 로드 | ||
|
||
# 10. GCP Credentials 디코딩 및 EC2로 전송 | ||
- name: Decode GCP Credentials | ||
run: echo "${{ secrets.GCP_CREDENTIALS }}" | base64 --decode > gcp-key.json | ||
# GitHub Secrets에 저장된 Base64 인코딩된 GCP JSON Key를 디코딩하여 로컬에 저장 | ||
|
||
- name: Copy GCP Credentials to EC2 | ||
run: scp -o StrictHostKeyChecking=no gcp-key.json ${{ secrets.EC2_USER }}@${{ secrets.EC2_IP_TWO }}:/home/${{ secrets.EC2_USER }}/gcp-key.json | ||
# 디코딩된 GCP JSON Key 파일을 EC2 서버로 전송 | ||
# YOUR_EC2_IP -> GitHub Secrets에 저장된 EC2 IP 주소 (${ secrets.EC2_IP }) | ||
# ec2-user -> GitHub Secrets에 저장된 EC2 SSH 사용자 이름 (${ secrets.EC2_USER }) | ||
|
||
# 11. EC2에서 GCP Credentials 설정 | ||
- name: Set up GCP Credentials on EC2 | ||
run: | | ||
ssh -o StrictHostKeyChecking=no ${{ secrets.EC2_USER }}@${{ secrets.EC2_IP_TWO }} << 'EOF' | ||
mkdir -p ~/.gcp | ||
mv /home/${{ secrets.EC2_USER }}/gcp-key.json ~/.gcp/key.json | ||
chmod 600 ~/.gcp/key.json | ||
export GOOGLE_APPLICATION_CREDENTIALS=~/.gcp/key.json | ||
# 환경 변수 설정을 영구적으로 추가 | ||
echo 'export GOOGLE_APPLICATION_CREDENTIALS=~/.gcp/key.json' >> ~/.bash_profile | ||
EOF | ||
# EC2 서버에서 GCP Credentials 설정 | ||
# YOUR_EC2_IP -> GitHub Secrets에 저장된 EC2 IP 주소 (${ secrets.EC2_IP }) | ||
# ec2-user -> GitHub Secrets에 저장된 EC2 SSH 사용자 이름 (${ secrets.EC2_USER }) | ||
|
||
# 12. Elastic Beanstalk에 배포 | ||
# 9. Elastic Beanstalk에 배포 | ||
- name: Deploy to Elastic Beanstalk | ||
uses: einaregilsson/beanstalk-deploy@v20 | ||
with: | ||
|