gateway-service prod CD 파이프라인 #6
This file contains hidden or 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
| name: gateway-service prod CD 파이프라인 | |
| on: | |
| workflow_run: | |
| workflows: ["gateway-service CI pipeline"] | |
| types: | |
| - completed | |
| jobs: | |
| deploy: | |
| if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
| runs-on: ubuntu-latest | |
| environment: prod | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Docker 이미지 dev 서버 배포 | |
| uses: appleboy/ssh-action@master | |
| with: | |
| host: ${{secrets.PROD_HOST}} | |
| username: ${{secrets.PROD_USERNAME}} | |
| key: ${{secrets.PROD_KEY}} | |
| script: | | |
| cd /home/ubuntu | |
| docker rm -f gateway-service-prod || true | |
| docker compose pull gateway-service-prod | |
| docker compose up -d --no-deps --force-recreate --pull always gateway-service-prod | |
| docker image prune -f |