[function] add helloworld controller #31
Workflow file for this run
This file contains 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: github action tag | |
permissions: | |
contents: write | |
on: | |
pull_request: | |
types: | |
- closed | |
jobs: | |
ifMergedTag: | |
if: github.event.pull_request.merged == true | |
runs-on: ubuntu-latest | |
outputs: | |
tagVersion: ${{ steps.bump-semver.outputs.new_version }} | |
steps: | |
- name: git checkout local | |
uses: actions/checkout@v4 | |
- name: get latest tag from local git | |
uses: actions-ecosystem/action-get-latest-tag@v1 | |
id: get-latest-tag | |
- name: plus minor version | |
uses: actions-ecosystem/action-bump-semver@v1 | |
id: bump-semver | |
with: | |
current_version: ${{ steps.get-latest-tag.outputs.tag }} | |
level: patch | |
- name: push tag to github origin main | |
uses: actions-ecosystem/action-push-tag@v1 | |
with: | |
tag: ${{ steps.bump-semver.outputs.new_version }} | |
message: '${{ steps.bump-semver.outputs.new_version }}: PR #${{ github.event.pull_request.number }} ${{ github.event.pull_request.title }}' | |
buildAndPushImageToDockerHub: | |
if: github.event.pull_request.merged == true | |
runs-on: ubuntu-latest | |
needs: ifMergedTag | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
# gradle 빌드 실행을 위한 권한을 부여 | |
- name: grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: gradle cleana and build image | |
run: ./gradlew clean bootBuildImage --imageName=docker.io/preference112/super-sns | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Push images | |
run: | | |
docker tag preference112/super-sns:latest preference112/super-sns:${{ needs.ifMergedTag.outputs.tagVersion }} | |
docker push preference112/super-sns:${{ needs.ifMergedTag.outputs.tagVersion }} | |
docker push preference112/super-sns:latest |