Skip to content

Commit

Permalink
fix: CI/CD 접속 전용 계정 적용 (#21)
Browse files Browse the repository at this point in the history
* fix: ssh 접속 계정명 변경과 패스워드 필드 제거

* fix: docker 명령어에 registry 값 추가
  • Loading branch information
kdomo authored Nov 27, 2023
1 parent 15d298f commit 76aaedd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/develop_build_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,11 @@ jobs:
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.NCP_HOST }}
username: root
password: ${{ secrets.NCP_PASSWORD }}
username: tenminute
key: ${{ secrets.NCP_PRIVATE_KEY }}
port: ${{ secrets.NCP_PORT }}
script: |
echo "${{ secrets.NCP_SECRET_KEY }}" | docker login -u "${{ secrets.NCP_ACCESS_KEY }}" --password-stdin "${{ secrets.NCP_CONTAINER_REGISTRY }}"
docker pull ${{ secrets.NCP_CONTAINER_REGISTRY }}/server-spring:${{ needs.build.outputs.sha }}
docker stop server-spring
docker run -d --name server-spring -p 8080:8080 -d server-spring:${{ needs.build.outputs.sha }}
docker stop server-spring && docker rm server-spring
docker run -d --name server-spring -p 8080:8080 -d ${{ secrets.NCP_CONTAINER_REGISTRY }}/server-spring:${{ needs.build.outputs.sha }}
4 changes: 2 additions & 2 deletions .github/workflows/develop_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ jobs:
script: |
echo "${{ secrets.NCP_SECRET_KEY }}" | docker login -u "${{ secrets.NCP_ACCESS_KEY }}" --password-stdin "${{ secrets.NCP_CONTAINER_REGISTRY }}"
docker pull ${{ secrets.NCP_CONTAINER_REGISTRY }}/server-spring:${{ github.event.inputs.commit_hash }}
docker stop server-spring
docker run -d --name server-spring -p 8080:8080 -d server-spring:${{ github.event.inputs.commit_hash }}
docker stop server-spring && docker rm server-spring
docker run -d --name server-spring -p 8080:8080 -d ${{ secrets.NCP_CONTAINER_REGISTRY }}/server-spring:${{ github.event.inputs.commit_hash }}

0 comments on commit 76aaedd

Please sign in to comment.