diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index a49c3af6..cfd0dff3 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -59,7 +59,10 @@ jobs: runs-on: self-hosted # weekly/* 브랜치에서는 실행되지 않도록 조건 추가 - if: startsWith(github.ref, 'refs/heads/Master') || startsWith(github.ref, 'refs/heads/develop') + # if: startsWith(github.ref, 'refs/heads/Master') || startsWith(github.ref, 'refs/heads/develop') + + # weekly/* 브랜치에서만 실행되도록 + if: startsWith(github.ref, 'refs/heads/weekly/') steps: # 최신 이미지를 pull @@ -76,13 +79,18 @@ jobs: echo "${{ secrets.ENV }}" >> .env # 브랜치에 따라 다른 환경 변수를 설정하여 컨테이너 실행 + # - name: docker run new container + # run: | + # if [ "${{ github.ref }}" == "refs/heads/Master" ]; then + # sudo docker run --name inplace --rm -d -p 8080:8080 --env-file .env ${{ secrets.DOCKERHUB_USERNAME }}/inplace + # elif [ "${{ github.ref }}" == "refs/heads/develop" ]; then + # sudo docker run --name inplace-dev --rm -d -p 8081:8080 --env-file .env ${{ secrets.DOCKERHUB_USERNAME }}/inplace + # fi + + # weekly/* 브랜치 8081 포트로 설정 - name: docker run new container run: | - if [ "${{ github.ref }}" == "refs/heads/Master" ]; then - sudo docker run --name inplace --rm -d -p 8080:8080 --env-file .env ${{ secrets.DOCKERHUB_USERNAME }}/inplace - elif [ "${{ github.ref }}" == "refs/heads/develop" ]; then - sudo docker run --name inplace-dev --rm -d -p 8081:8080 --env-file .env ${{ secrets.DOCKERHUB_USERNAME }}/inplace - fi + sudo docker run --name inplace-dev --rm -d -p 8081:8080 --env-file .env ${{ secrets.DOCKERHUB_USERNAME }}/inplace # 미사용 이미지를 정리 - name: delete old docker image