diff --git a/.github/workflows/CD.yml b/.github/workflows/CD.yml new file mode 100644 index 0000000..992b073 --- /dev/null +++ b/.github/workflows/CD.yml @@ -0,0 +1,38 @@ +name: CD + +on: + push: + branches: [ "main" ] + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - name: Check Out The Repository + uses: actions/checkout@v3 + + - name: Set up Java + uses: actions/setup-java@v2 + with: + java-version: 11 + distribution: 'adopt' + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + - name: Build with Gradle + run: ./gradlew build --info + - name: check gradle + run: ./gradlew check + + - name: Login to Dockerhub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Docker Build + run: docker build -t jyk1029/boheom . + + - name: Push on Dockerhub + run: docker push jyk1029/boheom