-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
⚙️ chore: github ip를 ag에 추가 및 제거 하는 작업 추가
- Loading branch information
Showing
1 changed file
with
24 additions
and
0 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 |
---|---|---|
|
@@ -65,6 +65,24 @@ jobs: | |
docker push ${{ env.DOCKER_IMAGE }}:${{ env.DOCKER_TAG }} | ||
docker push ${{ env.DOCKER_IMAGE }}:latest | ||
- name: Get Github Actions IP | ||
id: ip | ||
uses: haythem/[email protected] | ||
|
||
- name: Setting NCP CLI & Credentials | ||
run: | | ||
cd ~ | ||
wget https://www.ncloud.com/api/support/download/5/65 | ||
unzip 65 | ||
mkdir ~/.ncloud | ||
echo -e "[DEFAULT]\nncloud_access_key_id = ${{ secrets.NCP_ACCESS_KEY }}\nncloud_secret_access_key = ${{ secrets.NCP_SECRET_KEY }}\nncloud_api_url = ${{ secrets.NCP_API_URI }}" >> ~/.ncloud/configure | ||
- name: Add Github Action Ip to Security group | ||
run: | | ||
chmod -R 777 ~/cli_linux | ||
cd ~/cli_linux | ||
./ncloud vserver addAccessControlGroupInboundRule --regionCode KR --vpcNo ${{ secrets.NCP_VPC_ID }} --accessControlGroupNo ${{ secrets.NCP_ACG_ID }} --accessControlGroupRuleList "protocolTypeCode='TCP', ipBlock='${{ steps.ip.outputs.ipv4 }}/32', portRange='${{ secrets.SSH_PORT }}'" | ||
- name: Deploy to NCP Server | ||
uses: appleboy/ssh-action@master | ||
with: | ||
|
@@ -80,3 +98,9 @@ jobs: | |
--name juga-docker \ | ||
-p 3000:3000 \ | ||
${{ env.DOCKER_IMAGE }}:${{ env.DOCKER_TAG }} | ||
- name: Remove Github Action Ip to Security group | ||
run: | | ||
chmod -R 777 ~/cli_linux | ||
cd ~/cli_linux | ||
./ncloud vserver removeAccessControlGroupInboundRule --regionCode KR --vpcNo ${{ secrets.NCP_VPC_ID }} --accessControlGroupNo ${{ secrets.NCP_ACG_ID }} --accessControlGroupRuleList "protocolTypeCode='TCP', ipBlock='${{ steps.ip.outputs.ipv4 }}/32', portRange='${{ secrets.SSH_PORT }}'" |