From 786634154103f954129f8a533f61ad6359f387e6 Mon Sep 17 00:00:00 2001 From: gol2580 <86960201+gol2580@users.noreply.github.com> Date: Thu, 18 Jan 2024 00:09:33 +0900 Subject: [PATCH 1/2] Update github-action.yml --- .github/workflows/github-action.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/github-action.yml b/.github/workflows/github-action.yml index a125f8d..cf3b87b 100644 --- a/.github/workflows/github-action.yml +++ b/.github/workflows/github-action.yml @@ -34,14 +34,14 @@ jobs: touch ./security.properties # GitHub-Actions에서 설정한 값을 security.properties 파일에 쓰기 - echo "${{ secrets.PROPERTIES }}" > ./security.properties + echo "${{ secrets.USERNAME }}" > ./security.properties shell: bash - name: create firebase key run: | cd ./src/main/resources touch ./kimgreen-f33e5-firebase-adminsdk-63srz-6817b2eec4.json - echo "${{ secrets.FIREBASE_KEY }}" > ./kimgreen-f33e5-firebase-adminsdk-63srz-6817b2eec4.json + echo "${{ secrets.USERNAME }}" > ./kimgreen-f33e5-firebase-adminsdk-63srz-6817b2eec4.json - name: Build with Gradle run: | @@ -64,6 +64,6 @@ jobs: script: | sudo docker ps sudo docker pull ${{ secrets.DOCKER_USERNAME }}/kimgreen - sudo docker run -d -p 8080:8080 ${{ secrets.DOCKER_USERNAME }}/kimgreen + sudo docker run -d --name server -e TZ=Asia/Seoul -p 8080:8080 ${{ secrets.DOCKER_USERNAME }}/kimgreen sudo docker image prune -f From 1f142266dc041e8c3b0d4efacde7cf2d7a989b48 Mon Sep 17 00:00:00 2001 From: gol2580 <86960201+gol2580@users.noreply.github.com> Date: Thu, 18 Jan 2024 01:59:04 +0900 Subject: [PATCH 2/2] Update github-action.yml --- .github/workflows/github-action.yml | 36 ++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/.github/workflows/github-action.yml b/.github/workflows/github-action.yml index cf3b87b..85c434f 100644 --- a/.github/workflows/github-action.yml +++ b/.github/workflows/github-action.yml @@ -16,6 +16,19 @@ on: jobs: CI-CD: runs-on: ubuntu-latest + + # github action 내부에서 쓰는 변 + env: + DATASOURCE_URL_RDS: ${{ secrets.DATASOURCE_URL_RDS }} + DATASOURCE_USERNAME_RDS: ${{ secrets.DATASOURCE_USERNAME_RDS }} + jwt.secret-key: ${{ secrets.jwt.secret-key }} + aws.credentials.access-key: ${{ secrets. aws.credentials.access-key }} + aws.credentials.secret-key: ${{ secrets.aws.credentials.secret-key }} + aws.region.static: ${{ secrets.aws.region.static }} + aws.s3.bucket: ${{ secrets.aws.s3.bucket }} + fcm.url: ${{ secrets.fcm.url }} + + steps: - uses: actions/checkout@v3 - name: Set up JDK 17 @@ -24,18 +37,25 @@ jobs: java-version: '17' distribution: 'temurin' # https://github.com/actions/setup-java - - ## create security.properties - - name: make security.properties + ## create env file + - name: create env file run: | - cd ./src/main/resources + touch .env + echo "${{ secrets.PROPERTIES }}" >> .env + + + + ## delete : create security.properties + ##- name: make security.properties + ##run: | + ##cd ./src/main/resources # security.properties 파일 생성 - touch ./security.properties + ##touch ./security.properties # GitHub-Actions에서 설정한 값을 security.properties 파일에 쓰기 - echo "${{ secrets.USERNAME }}" > ./security.properties - shell: bash + ##echo "${{ secrets.USERNAME }}" > ./security.properties + ##shell: bash - name: create firebase key run: | @@ -64,6 +84,6 @@ jobs: script: | sudo docker ps sudo docker pull ${{ secrets.DOCKER_USERNAME }}/kimgreen - sudo docker run -d --name server -e TZ=Asia/Seoul -p 8080:8080 ${{ secrets.DOCKER_USERNAME }}/kimgreen + sudo docker-compose up -d sudo docker image prune -f