docker-image.yml 변경 #4
This file contains 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: Docker Image CI | |
on: | |
push: | |
branches: ["develop"] | |
jobs: | |
CI-CD: | |
runs-on: ubuntu-latest | |
steps: | |
# gradle caching - 빌드 시간 향상 | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Build with Gradle | |
run: ./gradlew build -x test | |
- name: Docker build & push | |
if: contains(github.ref, 'develop') | |
run: | | |
docker login -u yooonwodyd00 -p dbswodyd91 | |
docker build -f Dockerfile -t yooonwodyd00/happynewhere_be-app . | |
docker push yooonwodyd00/happynewhere_be-app |