Skip to content

Commit

Permalink
Merge pull request #24 from billbill-project/fix/auth/v1
Browse files Browse the repository at this point in the history
[fix] yml문 변경
  • Loading branch information
jainefer authored Nov 5, 2024
2 parents db9ac2b + d8cff47 commit 38a44b4
Showing 1 changed file with 39 additions and 20 deletions.
59 changes: 39 additions & 20 deletions .github/workflows/dev_deply.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,32 +54,51 @@ jobs:
with:
host: ${{ secrets.EC2_SERVER_HOST }}
username: ubuntu
key: ${{ secrets.EC2_PRIVATE_KEY}}
script : |
key: ${{ secrets.EC2_PRIVATE_KEY }}
script: |
sudo docker pull ${{ secrets.DOCKERHUB_USERNAME }}/bill-api:latest
if [ $(docker ps -a -q -f name=bill-api) ]; then
sudo docker stop bill-api
sudo docker rm bill-api
fi
sudo docker tag jainefer/bill-api:latest bill-api
docker run --name bill-api -d -p 80:8080 \
-e SPRING_DATASOURCE_URL=${{secrets.SPRING_DATASOURCE_URL}} \
-e SPRING_DATASOURCE_USERNAME=${{secrets.SPRING_DATASOURCE_USERNAME}} \
-e SPRING_DATASOURCE_PASSWORD=${{secrets.SPRING_DATASOURCE_PASSWORD}} \
-e SPRING_DATASOURCE_DRIVER_CLASS_NAME=${{secrets.SPRING_DATASOURCE_DRIVER_CLASS_NAME}} \
-e JWT_BILL_SECRET_KEY=${{secrets.JWT_BILL_SECRET_KEY}} \
-e JWT_BILL_ACCESS_TOKEN_EXPIRED=${{secrets.JWT_BILL_ACCESS_TOKEN_EXPIRED}} \
-e JWT_BILL_REFRESH_TOKEN_EXPIRED=${{secrets.JWT_BILL_REFRESH_TOKEN_EXPIRED}} \
-e SPRINGDOC_API_DOCS_PATH=${{secrets.SPRINGDOC_API_DOCS_PATH}} \
-e SPRINGDOC_CACHE_DISABLED=${{secrets.SPRINGDOC_CACHE_DISABLED}} \
-e SPRINGDOC_DEFAULT_CONSUMES_MEDIA_TYPE=${{secrets.SPRINGDOC_DEFAULT_CONSUMES_MEDIA_TYPE}} \
-e SPRINGDOC_DEFAULT_PRODUCES_MEDIA_TYPE=${{secrets.SPRINGDOC_DEFAULT_PRODUCES_MEDIA_TYPE}} \
-e SPRINGDOC_PACKAGES_TO_SCAN=${{secrets.SPRINGDOC_PACKAGES_TO_SCAN}} \
-e SPRINGDOC_SWAGGER_UI_DISABLE_SWAGGER_DEFAULT_URL=${{secrets.SPRINGDOC_SWAGGER_UI_DISABLE_SWAGGER_DEFAULT_URL}} \
-e SPRINGDOC_SWAGGER_UI_OPERATIONS_SORTER=${{secrets.SPRINGDOC_SWAGGER_UI_OPERATIONS_SORTER}} \
-e SPRINGDOC_SWAGGER_UI_PATH=${{secrets.SPRINGDOC_SWAGGER_UI_PATH}} \
-e SPRING_DEVTOOLS_LIVERELOAD_ENABLE=${{secrets.SPRING_DEVTOOLS_LIVERELOAD_ENABLE}} \
# Export environment variables
export SPRING_DATASOURCE_URL="${{ secrets.SPRING_DATASOURCE_URL }}"
export SPRING_DATASOURCE_USERNAME="${{ secrets.SPRING_DATASOURCE_USERNAME }}"
export SPRING_DATASOURCE_PASSWORD="${{ secrets.SPRING_DATASOURCE_PASSWORD }}"
export SPRING_DATASOURCE_DRIVER_CLASS_NAME="${{ secrets.SPRING_DATASOURCE_DRIVER_CLASS_NAME }}"
export JWT_BILL_SECRET_KEY="${{ secrets.JWT_BILL_SECRET_KEY }}"
export JWT_BILL_ACCESS_TOKEN_EXPIRED="${{ secrets.JWT_BILL_ACCESS_TOKEN_EXPIRED }}"
export JWT_BILL_REFRESH_TOKEN_EXPIRED="${{ secrets.JWT_BILL_REFRESH_TOKEN_EXPIRED }}"
export SPRINGDOC_API_DOCS_PATH="${{ secrets.SPRINGDOC_API_DOCS_PATH }}"
export SPRINGDOC_CACHE_DISABLED="${{ secrets.SPRINGDOC_CACHE_DISABLED }}"
export SPRINGDOC_DEFAULT_CONSUMES_MEDIA_TYPE="${{ secrets.SPRINGDOC_DEFAULT_CONSUMES_MEDIA_TYPE }}"
export SPRINGDOC_DEFAULT_PRODUCES_MEDIA_TYPE="${{ secrets.SPRINGDOC_DEFAULT_PRODUCES_MEDIA_TYPE }}"
export SPRINGDOC_PACKAGES_TO_SCAN="${{ secrets.SPRINGDOC_PACKAGES_TO_SCAN }}"
export SPRINGDOC_SWAGGER_UI_DISABLE_SWAGGER_DEFAULT_URL="${{ secrets.SPRINGDOC_SWAGGER_UI_DISABLE_SWAGGER_DEFAULT_URL }}"
export SPRINGDOC_SWAGGER_UI_OPERATIONS_SORTER="${{ secrets.SPRINGDOC_SWAGGER_UI_OPERATIONS_SORTER }}"
export SPRINGDOC_SWAGGER_UI_PATH="${{ secrets.SPRINGDOC_SWAGGER_UI_PATH }}"
export SPRING_DEVTOOLS_LIVERELOAD_ENABLE="${{ secrets.SPRING_DEVTOOLS_LIVERELOAD_ENABLE }}"
# Run the container with environment variables
sudo docker run --name bill-api -d -p 80:8080 \
-e SPRING_DATASOURCE_URL="$SPRING_DATASOURCE_URL" \
-e SPRING_DATASOURCE_USERNAME="$SPRING_DATASOURCE_USERNAME" \
-e SPRING_DATASOURCE_PASSWORD="$SPRING_DATASOURCE_PASSWORD" \
-e SPRING_DATASOURCE_DRIVER_CLASS_NAME="$SPRING_DATASOURCE_DRIVER_CLASS_NAME" \
-e JWT_BILL_SECRET_KEY="$JWT_BILL_SECRET_KEY" \
-e JWT_BILL_ACCESS_TOKEN_EXPIRED="$JWT_BILL_ACCESS_TOKEN_EXPIRED" \
-e JWT_BILL_REFRESH_TOKEN_EXPIRED="$JWT_BILL_REFRESH_TOKEN_EXPIRED" \
-e SPRINGDOC_API_DOCS_PATH="$SPRINGDOC_API_DOCS_PATH" \
-e SPRINGDOC_CACHE_DISABLED="$SPRINGDOC_CACHE_DISABLED" \
-e SPRINGDOC_DEFAULT_CONSUMES_MEDIA_TYPE="$SPRINGDOC_DEFAULT_CONSUMES_MEDIA_TYPE" \
-e SPRINGDOC_DEFAULT_PRODUCES_MEDIA_TYPE="$SPRINGDOC_DEFAULT_PRODUCES_MEDIA_TYPE" \
-e SPRINGDOC_PACKAGES_TO_SCAN="$SPRINGDOC_PACKAGES_TO_SCAN" \
-e SPRINGDOC_SWAGGER_UI_DISABLE_SWAGGER_DEFAULT_URL="$SPRINGDOC_SWAGGER_UI_DISABLE_SWAGGER_DEFAULT_URL" \
-e SPRINGDOC_SWAGGER_UI_OPERATIONS_SORTER="$SPRINGDOC_SWAGGER_UI_OPERATIONS_SORTER" \
-e SPRINGDOC_SWAGGER_UI_PATH="$SPRINGDOC_SWAGGER_UI_PATH" \
-e SPRING_DEVTOOLS_LIVERELOAD_ENABLE="$SPRING_DEVTOOLS_LIVERELOAD_ENABLE" \
${{ secrets.DOCKERHUB_USERNAME }}/bill-api:latest
sudo docker rm $(sudo docker ps --filter 'status=exited' -a -q)
sudo docker image prune -a -f

0 comments on commit 38a44b4

Please sign in to comment.