Skip to content

Commit e3f3b21

Browse files
authored
Merge pull request #16 from kookmin-sw/init/15
[Backend] init: GitHub Action CI 구축
2 parents 1b82fa7 + 1d25bb3 commit e3f3b21

File tree

1 file changed

+81
-0
lines changed

1 file changed

+81
-0
lines changed

.github/workflows/backend-ci.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
6+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle
7+
8+
name: Backend CI
9+
10+
on:
11+
push:
12+
paths:
13+
- "backend/**"
14+
pull_request:
15+
paths:
16+
- "backend/**"
17+
18+
jobs:
19+
build:
20+
21+
runs-on: ubuntu-latest
22+
permissions:
23+
contents: read
24+
defaults:
25+
run:
26+
working-directory: ./backend
27+
28+
steps:
29+
- uses: actions/checkout@v4
30+
- name: Set up JDK 21
31+
uses: actions/setup-java@v4
32+
with:
33+
java-version: '21'
34+
distribution: 'temurin'
35+
36+
# Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies.
37+
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md
38+
- name: Grant execute permission for gradlew
39+
run: chmod +x gradlew
40+
41+
- name: Setup Gradle
42+
uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0
43+
44+
- name: Build with Gradle Wrapper
45+
run: ./gradlew build
46+
47+
# NOTE: The Gradle Wrapper is the default and recommended way to run Gradle (https://docs.gradle.org/current/userguide/gradle_wrapper.html).
48+
# If your project does not have the Gradle Wrapper configured, you can use the following configuration to run Gradle with a specified version.
49+
#
50+
# - name: Setup Gradle
51+
# uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0
52+
# with:
53+
# gradle-version: '8.9'
54+
#
55+
# - name: Build with Gradle 8.9
56+
# run: gradle build
57+
58+
dependency-submission:
59+
60+
runs-on: ubuntu-latest
61+
permissions:
62+
contents: write
63+
defaults:
64+
run:
65+
working-directory: ./backend
66+
67+
steps:
68+
- uses: actions/checkout@v4
69+
- name: Set up JDK 21
70+
uses: actions/setup-java@v4
71+
with:
72+
java-version: '21'
73+
distribution: 'temurin'
74+
75+
# Generates and submits a dependency graph, enabling Dependabot Alerts for all project dependencies.
76+
# See: https://github.com/gradle/actions/blob/main/dependency-submission/README.md
77+
- name: Generate and submit dependency graph
78+
uses: gradle/actions/dependency-submission@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0
79+
with:
80+
gradle-version: '8.12.1'
81+
build-root-directory: ./backend

0 commit comments

Comments
 (0)