Skip to content

Commit

Permalink
Update backend.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
bbbang105 authored May 26, 2024
1 parent ca49c84 commit 7e4c888
Showing 1 changed file with 25 additions and 16 deletions.
41 changes: 25 additions & 16 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: 🦉 Checkout code
uses: actions/checkout@v3

- name: 🦉 Set up JDK 17
uses: actions/setup-java@v3
with:
Expand All @@ -37,25 +38,33 @@ jobs:
restore-keys: |
${{ runner.os }}-gradle-
- name: 🦉 Change directory to 'backend'
run: cd backend

- name: 🦉 Set execution permission for Gradle Wrapper
run: chmod +x gradlew
- name: 🦉 gradle build를 위한 권한을 부여합니다.
run: |
cd backend
chmod +x gradlew
- name: 🦉 Run Gradle Wrapper to specify Gradle version
run: ./gradlew wrapper --gradle-version 8.7
- name: 🦉 gradle wrapper를 통한 Gradle 버전 지정
run: |
cd backend
./gradlew wrapper --gradle-version 8.7
- name: 🦉 Clean Gradle cache
run: ./gradlew clea
- name: 🦉 gradle 캐시 삭제
run: |
cd backend
./gradlew clean
- name: 🦉 Build with Gradle
- name: 🦉 gradle build 중입니다.
run: |
cd backend
./gradlew build -x test --stacktrace
- name: 🦉 Docker login and build Docker image
- name: 🦉 Docker Hub에 로그인 후, docker image build 후 Docker Hub에 push합니다.
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
DOCKERHUB_REPOSITORY: ${{ secrets.DOCKERHUB_REPOSITORY }}
run: |
docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_PASSWORD }}
docker build -f Dockerfile -t ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPOSITORY }}:latest .
docker push ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPOSITORY }}:latest
cd backend
docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD
docker build -t $DOCKERHUB_USERNAME/$DOCKERHUB_REPOSITORY:latest .
docker push $DOCKERHUB_USERNAME/$DOCKERHUB_REPOSITORY:latest

0 comments on commit 7e4c888

Please sign in to comment.