티스토리 뷰
github aciton 에 맞는 yaml 파일을 .github/workflows 아래에 생성합니다.
그리고 pr 을 생성하고, comment 에 /build 를 입력하면 실행됩니다.
name: Build on Comment
on:
issue_comment:
types: [created]
jobs:
build_image:
# 코멘트가 '/build'이고, PR에 작성된 코멘트인 경우에만 실행
if: github.event.issue.pull_request && contains(github.event.comment.body, '/build')
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub (Optional)
# Docker Hub에 이미지를 푸시하려면 주석을 해제하고 사용자 이름과 토큰을 설정하세요.
# Docker Hub 이외의 레지스트리를 사용하는 경우 해당 레지스트리에 맞게 수정하세요.
# uses: docker/login-action@v3
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
run: echo "Docker login step skipped for now. Uncomment and configure if needed."
- name: Build Docker image
# 'DOCKERHUB_USERNAME/IMAGE_NAME:TAG' 부분을 실제 이미지 이름과 태그로 변경하세요.
# Dockerfile의 위치가 루트 디렉토리가 아니라면 context와 file 옵션을 수정하세요.
run: |
docker build -t my-image:latest .
echo "Docker image built: my-image:latest"
# - name: Push Docker image (Optional)
# # 이미지를 푸시하려면 주Kk석을 해제하고 이미지 이름을 수정하세요.
# # run: docker push my-image:latest
# run: echo "Docker push step skipped for now. Uncomment if needed."
- name: Add reaction to comment
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{ github.event.comment.id }}
reaction-type: '+1' # 빌드 시작을 알리는 반응 (예: 👍)
- name: Comment on build completion (Optional)
# 빌드 완료 후 코멘트를 남기려면 주석을 해제하세요.
# uses: peter-evans/create-or-update-comment@v4
# with:
# issue-number: ${{ github.event.issue.number }}
# body: |
# Image build triggered by @${{ github.event.comment.user.login }} has completed.
# Image: my-image:latest
run: echo "Build completion comment step skipped for now. Uncomment if needed."
반응형
반응형
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- error
- S3
- Linux
- 알고리즘
- HIVE
- HDFS
- 파이썬
- nodejs
- SPARK
- Tez
- 백준
- 정올
- yarn
- 오류
- AWS
- 하이브
- mysql
- bash
- emr
- java
- 다이나믹
- 하둡
- ubuntu
- Hadoop
- airflow
- hbase
- Python
- oozie
- k8s
- build
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
글 보관함