[chore] delete many 시 조건을 null 체크로 처리해 항상 예외로 간주하는 문제 수정 (#147) #161
Workflow file for this run
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
name: CD | |
on: | |
push: | |
branches: [ "dev" ] | |
pull_request: | |
branches: [ "dev" ] | |
types: [closed] | |
workflow_dispatch: | |
permissions: | |
contents: read | |
id-token: write | |
jobs: | |
deploy: | |
if: github.event.pull_request.merged == true | |
runs-on: self-hosted | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Docker Login | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
- name: Pull Docker Image | |
run: sudo docker pull ${{ secrets.DOCKERHUB_USERNAME }}/orange | |
- name: AWS credential | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: ${{ secrets.AWS_ROLE_NAME }} | |
role-session-name: GithubActions | |
aws-region: ${{ secrets.SSM_PARAMETER_REGION }} | |
- name: Get Parameter | |
id: get-parameter | |
run: | | |
sudo aws ssm get-parameter --name ${{ secrets.SSM_PARAMETER_NAME }} --with-decryption --region ${{ secrets.SSM_PARAMETER_REGION }} --query "Parameter.Value" --output text > .env | |
- name: Deploy with Docker Compose | |
run: | | |
cd infra | |
sudo docker-compose --env-file ../.env down | |
sudo docker-compose --env-file ../.env up -d | |
rm -f ../.env | |
sudo docker image prune -f |