Skip to content

Commit 96591b5

Browse files
committed
Chore: CI/CD 파이프라인 추가
1 parent 1653c9b commit 96591b5

2 files changed

Lines changed: 96 additions & 0 deletions

File tree

.github/workflows/cd.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: CD
2+
run-name: ${{ github.event.workflow_run.head_commit.message }}
3+
4+
on:
5+
workflow_run:
6+
workflows: [ "CI" ]
7+
types:
8+
- completed
9+
branches:
10+
- main
11+
12+
jobs:
13+
deploy:
14+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
21+
- name: Login to GitHub Container Registry
22+
uses: docker/login-action@v3
23+
with:
24+
registry: ghcr.io
25+
username: ${{ github.actor }}
26+
password: ${{ secrets.ORG_PAT }}
27+
28+
- name: Extract Docker image metadata
29+
id: meta
30+
uses: docker/metadata-action@v5
31+
with:
32+
images: ghcr.io/dungbik/flipnote-notification
33+
34+
- name: Build and push Docker image
35+
uses: docker/build-push-action@v6
36+
with:
37+
context: .
38+
push: true
39+
tags: ${{ steps.meta.outputs.tags }}
40+
labels: ${{ steps.meta.outputs.labels }}

.github/workflows/ci.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Set up JDK 21
20+
uses: actions/setup-java@v4
21+
with:
22+
java-version: '21'
23+
distribution: 'temurin'
24+
25+
- name: Setup Gradle
26+
uses: gradle/actions/setup-gradle@v4
27+
28+
- name: Grant execute permission for gradlew
29+
run: chmod +x gradlew
30+
31+
- name: Build with Gradle
32+
run: ./gradlew build -x test
33+
34+
- name: Run tests
35+
run: ./gradlew test
36+
37+
dependency-check:
38+
runs-on: ubuntu-latest
39+
40+
steps:
41+
- name: Checkout code
42+
uses: actions/checkout@v4
43+
44+
- name: Run dependency check
45+
uses: dependency-check/Dependency-Check_Action@main
46+
with:
47+
project: 'FlipNote-Notification'
48+
path: '.'
49+
format: 'HTML'
50+
51+
- name: Upload dependency check report
52+
uses: actions/upload-artifact@v4
53+
if: always()
54+
with:
55+
name: dependency-check-report
56+
path: reports/

0 commit comments

Comments
 (0)