test1 #9
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: Docker Publish # 워크플로우의 이름 | |
| on: | |
| push: | |
| branches: | |
| - minseonjae # 또는 메인 브랜치 이름 | |
| workflow_dispatch: # 수동 트리거 허용 | |
| jobs: | |
| build-and-push: # 작업 이름 | |
| runs-on: ubuntu-latest # Ubuntu 환경에서 실행 | |
| steps: | |
| - uses: actions/checkout@v4 # 코드 체크아웃 | |
| - name: Docker Buildx 설정 # Docker Buildx 설정 | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Docker Hub에 로그인 # Docker Hub에 로그인 | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKER_USERNAME }} # GitHub Secrets에서 사용자 이름 가져오기 | |
| password: ${{ secrets.DOCKER_PASSWORD }} # GitHub Secrets에서 비밀번호 가져오기 | |
| - name: Docker 이미지 빌드 및 푸시 # Docker 이미지 빌드 및 푸시 | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . # Dockerfile이 있는 디렉토리 | |
| push: true # 이미지를 Docker Hub에 푸시 | |
| tags: | | |
| your-docker-username/practice:latest | |
| your-docker-username/practice:${{ github.sha }} |