From 5ca7f03528827f4a4b056aaf94ebd636a6d182d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=B0=AC=EB=AF=B8?= Date: Thu, 15 Feb 2024 20:08:56 +0900 Subject: [PATCH] =?UTF-8?q?[STMT-6]=20:construction=5Fworker:=20CI-CD=20wo?= =?UTF-8?q?rkflow=20=EC=88=98=EC=A0=95=20-=20=ED=99=98=EA=B2=BD=EB=B3=80?= =?UTF-8?q?=EC=88=98=20=EC=84=A4=EC=A0=95=20(#17)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 파일 이름 변경 - github-actions.yml -> ci-cd.yml - gitignore에 application-secret.properties 파일 추가 Co-authored-by: zxcv9203 <41960243+zxcv9203@users.noreply.github.com> --- .../workflows/{github-actions.yml => ci-cd.yml} | 16 +++++++++++----- .gitignore | 2 ++ 2 files changed, 13 insertions(+), 5 deletions(-) rename .github/workflows/{github-actions.yml => ci-cd.yml} (85%) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/ci-cd.yml similarity index 85% rename from .github/workflows/github-actions.yml rename to .github/workflows/ci-cd.yml index ce9a5dd9..fb29acce 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/ci-cd.yml @@ -2,7 +2,6 @@ name: CI/CD using github actions & docker # event trigger -# main 브랜치에 push가 되었을 때 실행 on: push: branches: @@ -16,14 +15,23 @@ jobs: runs-on: ubuntu-latest steps: - # JDK setting - github actions에서 사용할 JDK 설정 + # JDK setting + - name: Checkout - uses: actions/checkout@v4 + - name: Set up JDK 21 uses: actions/setup-java@v4 with: java-version: '21' distribution: 'temurin' + - name: set environment variables + working-directory: ./ + run: | + pwd + touch src/main/resources/application-secret.properties + echo ${{ secrets.ENV }} >> src/main/resources/application-secret.properties + # gradle caching - 빌드 시간 향상 - name: Gradle Caching uses: actions/cache@v3 @@ -35,7 +43,6 @@ jobs: restore-keys: | ${{ runner.os }}-gradle- - # docker login - name: Login to Docker Hub uses: docker/login-action@v1 @@ -66,5 +73,4 @@ jobs: sudo docker stop stumeet-server docker container prune -f sudo docker run -it -d -p 8080:8080 --name stumeet-server ${{ secrets.DOCKER_USERNAME }}/server - sudo docker image prune -f - + sudo docker image prune -f \ No newline at end of file diff --git a/.gitignore b/.gitignore index c2065bc2..6e680609 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,5 @@ out/ ### VS Code ### .vscode/ + +application-secret.properties \ No newline at end of file