From c41e38f4e984578e82ae2ab22734dd9a80a6fd12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=EB=AF=B8=EB=9E=98?= Date: Fri, 23 Aug 2024 08:37:36 +0900 Subject: [PATCH 1/2] !hotfix :: add cors setting and change username --- .github/workflows/backend-publish.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/backend-publish.yml b/.github/workflows/backend-publish.yml index 61362f1..ad9aea0 100644 --- a/.github/workflows/backend-publish.yml +++ b/.github/workflows/backend-publish.yml @@ -21,6 +21,9 @@ jobs: run: | mkdir -p ./src/main/resources echo "${{ secrets.APPLICATION_PROD }}" > ./src/main/resources/application-prod.yml + echo "cors:" >> ./src/main/resources/application-prod.yml + echo " allowed-origin: allowed-origin" >> ./src/main/resources/application-prod.yml + echo " max-age: 2400" >> ./src/main/resources/application-prod.yml - name: Set executable permission run: chmod +x ./gradlew @@ -38,12 +41,12 @@ jobs: uses: appleboy/ssh-action@master with: host: ${{ secrets.HOST_PROD }} - username: ec2-user + username: ubuntu key: ${{ secrets.PRIVATE_KEY }} envs: GITHUB_SHA script: | - sudo docker stop spaced - sudo docker rm spaced + sudo docker stop spaced || true + sudo docker rm spaced || true sudo docker rmi ${{ secrets.DOCKER_USERNAME }}/spaced:0.0.1-SNAPSHOT sudo docker pull ${{ secrets.DOCKER_USERNAME }}/spaced:0.0.1-SNAPSHOT sudo docker run -d -p 8080:8080 --name spaced ${{ secrets.DOCKER_USERNAME }}/spaced:0.0.1-SNAPSHOT \ From cfcb451738e35bf7e25bd13483868b462f221f7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=EB=AF=B8=EB=9E=98?= Date: Fri, 23 Aug 2024 11:38:49 +0900 Subject: [PATCH 2/2] !hotfix :: change allowed origin to secret --- .github/workflows/backend-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/backend-publish.yml b/.github/workflows/backend-publish.yml index ad9aea0..fd83a36 100644 --- a/.github/workflows/backend-publish.yml +++ b/.github/workflows/backend-publish.yml @@ -22,7 +22,7 @@ jobs: mkdir -p ./src/main/resources echo "${{ secrets.APPLICATION_PROD }}" > ./src/main/resources/application-prod.yml echo "cors:" >> ./src/main/resources/application-prod.yml - echo " allowed-origin: allowed-origin" >> ./src/main/resources/application-prod.yml + echo " allowed-origin: ${{ secrets.ALLOWED_ORIGIN }}" >> ./src/main/resources/application-prod.yml echo " max-age: 2400" >> ./src/main/resources/application-prod.yml - name: Set executable permission