feat: swagger https #46
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: Container Registry CI/CD Pipeline (Watchtower Auto-Deploy) | |
| on: | |
| push: | |
| branches: | |
| - master | |
| env: | |
| REGISTRY_URL: ${{ secrets.NCP_REGISTRY_URL }} | |
| IMAGE_NAME: meme-wiki-be | |
| jobs: | |
| build-and-push: | |
| name: Build and Push to Registry | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v3 | |
| with: | |
| java-version: '21' | |
| distribution: 'temurin' | |
| cache: gradle | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x gradlew | |
| - name: Build with Gradle | |
| run: ./gradlew clean build -x test | |
| - name: Get commit SHA | |
| id: vars | |
| run: | | |
| echo "SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
| echo "TIMESTAMP=$(date +%Y%m%d-%H%M%S)" >> $GITHUB_OUTPUT | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to NCP Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY_URL }} | |
| username: ${{ secrets.NCP_ACCESS_KEY }} | |
| password: ${{ secrets.NCP_SECRET_KEY }} | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| push: true | |
| tags: | | |
| ${{ env.REGISTRY_URL }}/${{ env.IMAGE_NAME }}:latest | |
| ${{ env.REGISTRY_URL }}/${{ env.IMAGE_NAME }}:${{ steps.vars.outputs.SHORT_SHA }} | |
| ${{ env.REGISTRY_URL }}/${{ env.IMAGE_NAME }}:${{ steps.vars.outputs.TIMESTAMP }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| - name: Deployment completed | |
| run: | | |
| echo "✅ 이미지 배포 완료: ${{ env.REGISTRY_URL }}/${{ env.IMAGE_NAME }}:latest" | |
| echo "🐳 Watchtower가 5분 내 자동 배포 시작" |