-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
github actions workflow 수정
- Loading branch information
Showing
4 changed files
with
168 additions
and
243 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,81 +1,81 @@ | ||
## This workflow uses actions that are not certified by GitHub. | ||
## They are provided by a third-party and are governed by | ||
## separate terms of service, privacy policy, and support | ||
## documentation. | ||
## This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time | ||
## For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle | ||
# | ||
#name: Java CI with Gradle | ||
# | ||
#on: | ||
# push: | ||
# branches: [ "develop" ] | ||
# | ||
#permissions: | ||
# contents: read | ||
# | ||
#jobs: | ||
# build: | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - name: checkout | ||
# uses: actions/checkout@v3 | ||
# | ||
# # JDK를 17 버전으로 세팅 | ||
# - name: Set up JDK 17 | ||
# uses: actions/setup-java@v3 | ||
# with: | ||
# java-version: '17' | ||
# distribution: 'temurin' | ||
# | ||
# # Gradle 캐싱-> 빌드 속도 UP | ||
# - name: Gradle caching | ||
# uses: actions/cache@v3 | ||
# with: | ||
# path: | | ||
# ~/.gradle/caches | ||
# ~/.gradle/wrapper | ||
# key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | ||
# restore-keys: | | ||
# ${{ runner.os }}-gradle- | ||
# | ||
# # application.yml 파일 생성 | ||
# - name: make application.yaml | ||
# run: | | ||
# cd ./src/main/resources | ||
# touch ./application.yml | ||
# echo "${{ secrets.APPLICATION }}" >> ./application.yml | ||
# shell: bash | ||
# | ||
# # Gradle로 빌드 실행 | ||
# - name: Build with Gradle | ||
# run: ./gradlew bootJar | ||
# | ||
# # image로부터 Metadata 추출 | ||
# - name: Extract metadata (tags, labels) for Docker | ||
# id: meta | ||
# uses: docker/metadata-action@v4 | ||
# with: | ||
# images: ${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_REPO }} | ||
# tags: | | ||
# type=sha | ||
# | ||
# # image 빌드 및 도커허브에 push | ||
# - name: web docker build and push | ||
# run: | | ||
# docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_ACCESS_TOKEN }} | ||
# docker build -t ${{ secrets.DOCKER_REPO }}/seniors:${{ steps.meta.outputs.version }} . | ||
# docker push ${{ secrets.DOCKER_REPO }}/seniors:${{ steps.meta.outputs.version }} | ||
# | ||
# # 빌드 결과 Slack 알람 전송 | ||
# - name: Send Slack Alarms | ||
# uses: rtCamp/action-slack-notify@v2 | ||
# env: | ||
# SLACK_CHANNEL: general | ||
# SLACK_COLOR: ${{ job.status }} # or a specific color like 'good' or '#ff00ff' | ||
# SLACK_ICON: https://github.com/rtCamp.png?size=48 | ||
# SLACK_MESSAGE: 빌드 결과 => ${{ job.status }} | ||
# SLACK_TITLE: 빌드 결과 알람 | ||
# SLACK_USERNAME: Notification-Bot | ||
# SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} | ||
# if: always() | ||
# This workflow uses actions that are not certified by GitHub. | ||
# They are provided by a third-party and are governed by | ||
# separate terms of service, privacy policy, and support | ||
# documentation. | ||
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle | ||
|
||
name: Java CI with Gradle | ||
|
||
on: | ||
push: | ||
branches: [ "develop" ] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v3 | ||
|
||
# JDK를 17 버전으로 세팅 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
|
||
# Gradle 캐싱-> 빌드 속도 UP | ||
- name: Gradle caching | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | ||
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
# application.yml 파일 생성 | ||
- name: make application.yaml | ||
run: | | ||
cd ./src/main/resources | ||
touch ./application.yml | ||
echo "${{ secrets.APPLICATION }}" >> ./application.yml | ||
shell: bash | ||
|
||
# Gradle로 빌드 실행 | ||
- name: Build with Gradle | ||
run: ./gradlew bootJar | ||
|
||
# image로부터 Metadata 추출 | ||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: ${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_REPO }} | ||
tags: | | ||
type=sha | ||
# image 빌드 및 도커허브에 push | ||
- name: web docker build and push | ||
run: | | ||
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_ACCESS_TOKEN }} | ||
docker build -t ${{ secrets.DOCKER_REPO }}/seniors:${{ steps.meta.outputs.version }} . | ||
docker push ${{ secrets.DOCKER_REPO }}/seniors:${{ steps.meta.outputs.version }} | ||
# 빌드 결과 Slack 알람 전송 | ||
- name: Send Slack Alarms | ||
uses: rtCamp/action-slack-notify@v2 | ||
env: | ||
SLACK_CHANNEL: general | ||
SLACK_COLOR: ${{ job.status }} # or a specific color like 'good' or '#ff00ff' | ||
SLACK_ICON: https://github.com/rtCamp.png?size=48 | ||
SLACK_MESSAGE: 빌드 결과 => ${{ job.status }} | ||
SLACK_TITLE: 빌드 결과 알람 | ||
SLACK_USERNAME: Notification-Bot | ||
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} | ||
if: always() |
File renamed without changes.
Oops, something went wrong.