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