Skip to content

Commit

Permalink
👷 Update gha trigger from tag to branch
Browse files Browse the repository at this point in the history
  • Loading branch information
TProgramer committed Oct 19, 2023
1 parent 78e516e commit 359f6ce
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ name: Publish Image on Docker Hub
# Action의 Trigger 설정
on:
push:
tags:
- "v*"
branches:
- main

# 직렬 또는 병렬적으로 실행할 작업의 집합
jobs:
Expand Down Expand Up @@ -44,8 +44,10 @@ jobs:
- name: Build with Gradle
run: ./gradlew clean build

- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV
# Release 브랜치 이름에서 버전 정보 추출
- name: 버전 정보 추출
run: echo "##[set-output name=version;]$(echo '${{ github.event.head_commit.message }}' | egrep -o '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}')"
id: extract_version_name

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
Expand All @@ -65,6 +67,6 @@ jobs:
# platforms: linux/amd64
tags: |
tprogramer/my-container-test:latest
tprogramer/my-container-test:${{ env.RELEASE_VERSION }}
tprogramer/my-container-test:${{ steps.extract_version_name.outputs.version }}
cache-from: type=gha
cache-to: type=gha,mode=max
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
**Github Actions**

- 브랜치에 PR 시 캐싱을 적용한 빌드 테스트 실행
- 태그를 `push` 하면 Container Registry(Docker Hub)로 Docker 이미지 build 후 push
- main에 release가 `merge` 되면 Container Registry(Docker Hub)로 Docker 이미지 build 후 push

0 comments on commit 359f6ce

Please sign in to comment.