Skip to content

Commit

Permalink
fix(CI/CD) : 환경 변수 문제 해결.
Browse files Browse the repository at this point in the history
  • Loading branch information
F-hiller committed May 11, 2024
1 parent 534e76d commit f6787d2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
13 changes: 5 additions & 8 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,6 @@ jobs:

- name: Build with Gradle Wrapper
run: ./gradlew build -x test
env:
REDIS_HOST: ${{ secrets.REDIS_HOST }}
REDIS_PORT: ${{ secrets.REDIS_PORT }}
GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }}
GOOGLE_CLIENT_SECRET: ${{ secrets.GOOGLE_CLIENT_SECRET }}
GOOGLE_REDIRECT_URI: ${{ secrets.GOOGLE_REDIRECT_URI }}
JWT_SECRET: ${{ secrets.JWT_SECRET }}

- name: Login to Docker Hub
uses: docker/login-action@v2
Expand All @@ -43,7 +36,11 @@ jobs:
- name: Modify docker-compose.dev.yaml
run: |
sed -i "s|REPLACE_IMAGE_TAG|${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKER_REPOSITORY }}:${{ github.sha }}|g" docker-compose.dev.yaml
sed -i "s|REPLACE_IMAGE_TAG|${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKER_REPOSITORY }}:${{ github.sha }}|g" docker-compose.dev.yaml &&
sed -i "s|REPLACE_GOOGLE_CLIENT_ID|${{ secrets.GOOGLE_CLIENT_ID }}|g" docker-compose.dev.yaml &&
sed -i "s|REPLACE_GOOGLE_CLIENT_SECRET|${{ secrets.GOOGLE_CLIENT_SECRET }}|g" docker-compose.dev.yaml &&
sed -i "s|REPLACE_GOOGLE_REDIRECT_URI|${{ secrets.GOOGLE_REDIRECT_URI }}|g" docker-compose.dev.yaml &&
sed -i "s|REPLACE_JWT_SECRET|${{ secrets.JWT_SECRET }}|g" docker-compose.dev.yaml
- name: Send script to remote server
uses: appleboy/scp-action@master
Expand Down
7 changes: 7 additions & 0 deletions docker-compose.dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ services:

gradingx-server:
image: REPLACE_IMAGE_TAG
environment:
- REDIS_HOST=localhost
- REDIS_PORT=6379
- GOOGLE_CLIENT_ID=REPLACE_GOOGLE_CLIENT_ID
- GOOGLE_CLIENT_SECRET=REPLACE_GOOGLE_CLIENT_SECRET
- GOOGLE_REDIRECT_URI=REPLACE_GOOGLE_REDIRECT_URI
- JWT_SECRET=REPLACE_JWT_SECRET
ports:
- "8080:8080"
depends_on:
Expand Down

0 comments on commit f6787d2

Please sign in to comment.