Skip to content

Commit

Permalink
init : [workflows] BuildSocketServer yml 세팅
Browse files Browse the repository at this point in the history
  • Loading branch information
ImNM committed Dec 30, 2022
1 parent 78d6283 commit 80124f3
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/BuildSocketServer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Build Api Server
on:
push:
tags:
- Socket-v*.*.*

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java-version: [ 17 ]
outputs:
version: ${{ steps.get_version.outputs.BRANCH_NAME }}

steps:
- name: Check Out The Repository
uses: actions/checkout@v3

- name: Set up Java
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java-version }}
distribution: 'corretto'

- name: Get the version
id: get_version
run: |
RELEASE_VERSION_WITHOUT_V="$(cut -d'v' -f2 <<< ${GITHUB_REF#refs/*/})"
echo ::set-output name=VERSION::$RELEASE_VERSION_WITHOUT_V
- name: Gradle Build
uses: gradle/gradle-build-action@v2

- name: Execute Gradle build
run: ./gradlew :DuDung-Api:build --no-daemon

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v3
with:
context: ./DuDung-Api
push: true
tags: water0641/dudung-socket:${{ steps.get_version.outputs.VERSION }}

0 comments on commit 80124f3

Please sign in to comment.