Fix: docker login 방법 변경 #105
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: Java CI with Gradle | |
| on: | |
| push: | |
| branches: | |
| - develop | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # (1) 기본 체크아웃 | |
| - name: checkout | |
| uses: actions/checkout@v3 | |
| with: | |
| token: ${{ secrets.ACTION_TOKEN }} | |
| submodules: recursive | |
| # (4) JDK 17 세팅 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v3 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| # (5) gradlew 파일 실행 권한 설정 | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x ./gradlew | |
| shell: bash | |
| # (6) Gradle build (Test 포함) | |
| - name: Build with Gradle | |
| uses: gradle/gradle-build-action@v2 | |
| with: | |
| arguments: clean build -x test | |
| # (7) Docker build & push | |
| - name: Docker build & Push | |
| run: | | |
| echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_ID }}" --password-stdin | |
| docker build -t ${{ secrets.DOCKER_ID }}/doctech . | |
| docker push ${{ secrets.DOCKER_ID }}/doctech | |
| # (8) Deploy Images with Docker compose | |
| - name: Deploy Images with Docker compose | |
| uses: appleboy/ssh-action@master | |
| with: | |
| host: ${{ secrets.REMOTE_SSH_HOST }} | |
| port: ${{ secrets.REMOTE_SSH_PORT }} | |
| username: ${{ secrets.REMOTE_SSH_ID }} | |
| key: ${{ secrets.REMOTE_SSH_PRIVATE_KEY }} | |
| script_stop: true | |
| script: | | |
| cd DocTech/DocTech-backend | |
| docker-compose -p doctech down | |
| docker-compose -p doctech up -d |