Skip to content

Commit

Permalink
[Feat]: ci 액션 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
bayy1216 committed May 28, 2024
1 parent 67acae2 commit 4f423b5
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Build & Deploy

on:
push:
branches: [ "main" ] # main 브랜치에 push가 발생하면 workflow가 실행됩니다.
permissions:
contents: read # 권한을 설정합니다.

jobs:
ci:
runs-on: ubuntu-latest

# set up java
steps:
- name: Checkout Repository # 저장소를 체크아웃합니다.
uses: actions/checkout@v4

- name: Set up JDK 17 # JDK 17을 설정합니다.
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'corretto'

- name: Setup Gradle # Gradle을 설정합니다.
run: |
chmod +x ./gradlew
./gradlew clean build
- name: Build docker image and push to docker hub # Docker 이미지를 빌드하고 Docker Hub에 푸시합니다.
run: |
docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_TOKEN }}
docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKER_REPOSITORY }}:${{ github.sha }} .
docker push ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKER_REPOSITORY }}:${{ github.sha }}

0 comments on commit 4f423b5

Please sign in to comment.