쿠키 설정 추가 #87
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: ci | |
| on: | |
| push: | |
| branches: master | |
| jobs: | |
| login: | |
| runs-on: ubuntu-latest | |
| services: | |
| mysql: | |
| image: mysql:8.0 | |
| env: | |
| MYSQL_DATABASE: BallaDream | |
| MYSQL_ROOT_PASSWORD: ${{ secrets.DB_PASSWORD }} | |
| ports: | |
| - 3306:3306 | |
| options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=7s --health-retries=5 | |
| redis: | |
| image: redis:7.2 | |
| ports: | |
| - 6379:6379 | |
| options: >- | |
| --health-cmd "redis-cli ping" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - name: Github Repository 파일 불러오기 | |
| uses: actions/checkout@v4 | |
| - name: JDK 17버전 설치 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: 17 | |
| - name: 깃허브 파일 확인하기 | |
| run: | | |
| cd ./src/main/resources/data | |
| ls | |
| - name: application.yml 파일 만들기 | |
| run: echo "${{ secrets.APPLICATION_PROPERTIES }}" > ./src/main/resources/application.yml | |
| - name: gradle 권한 설정 | |
| run: chmod +x ./gradlew | |
| - name: 테스트 및 빌드하기 | |
| # run: ./gradlew clean build | |
| run: gradle build -x test | |
| - name: Log in to Docker Hub | |
| uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a | |
| with: | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| - name: Extract metadata (tags, labels) for Docker | |
| id: meta | |
| uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 | |
| with: | |
| # images: jaeker/docker-prt | |
| images: ${{ secrets.DOCKER_USERNAME }}/balladream | |
| - name: Build and push Docker image | |
| id: push | |
| uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| - name: SSH로 EC2에 접속하기 | |
| uses: appleboy/ssh-action@v1.0.3 | |
| with: | |
| host: ${{ secrets.EC2_HOST }} | |
| username: ${{ secrets.EC2_USERNAME }} | |
| key: ${{ secrets.EC2_PRIVATE_KEY }} | |
| script_stop: true | |
| script: | | |
| docker compose down | |
| docker compose pull | |
| docker compose up -d --build |