gss-api-app-dev-cd #34
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: gss-api-app-dev-cd | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: '배포할 api app 서비스 버전을 입력합니다.' | |
| required: true | |
| jobs: | |
| trigger: | |
| name: 개발 환경 배포 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| - name: Custom Deployment Task | |
| env: | |
| TAG: ${{ inputs.tag }} | |
| run: | | |
| echo "Image Name: $IMAGE_NAME" | |
| echo "Tag: $TAG" | |
| - name: Excuting remote ssh commands | |
| uses: appleboy/[email protected] | |
| env: | |
| TAG: ${{ inputs.tag }} | |
| with: | |
| host: ${{ secrets.REMOTE_IP }} | |
| username: ${{ secrets.REMOTE_USER }} | |
| key: ${{ secrets.REMOTE_PRIVATE_KEY }} | |
| envs: TAG | |
| script: | | |
| aws ecr get-login-password --region ap-northeast-2 | docker login --username AWS --password-stdin 493807290209.dkr.ecr.ap-northeast-2.amazonaws.com | |
| cd /home/ec2-user/deploy/api/dev | |
| sh ./deploy.sh $TAG |