Skip to content

fix: port number 수정 #17

fix: port number 수정

fix: port number 수정 #17

Workflow file for this run

name: Auth CI/CD
on:
push:
branches: [ develop ]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Clear Gradle cache
run: rm -rf ~/.gradle/caches/
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build --no-daemon
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push Docker image
run: |
docker build -t ${{ secrets.DOCKER_USERNAME }}/sunjoo:auth .
docker push ${{ secrets.DOCKER_USERNAME }}/sunjoo:auth
- name: SSH and Deploy
uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }}
script: |
docker pull ${{ secrets.DOCKER_USERNAME }}/sunjoo:auth
docker pull ${{ secrets.DOCKER_USERNAME }}/sunjoo:redis
if [ "$(docker ps -aq -f name=sunjoo-server-auth)" ]; then
docker stop sunjoo-server-auth
docker rm sunjoo-server-auth
fi
if [ "$(docker ps -aq -f name=sunjoo-server-redis)" ]; then
docker stop sunjoo-server-redis
docker rm sunjoo-server-redis
fi
docker run -d -p 8080:8090 --name sunjoo-server-auth ${{ secrets.DOCKER_USERNAME }}/sunjoo:auth
docker run -d -p 6380:6379 --name sunjoo-server-redis ${{ secrets.DOCKER_USERNAME }}/sunjoo:redis