Skip to content

MSTR-100 : 회원 API REST Docs 작성 #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Jul 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: deploy documentation

on:
push:
branches:
- dev

jobs:
deploy-docs:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
with:
token: ${{ secrets.PRIVATE_TOKEN }}
submodules: true

- name: setup jdk 11
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '11'
cache: 'gradle'

- name: Start Redis
uses: supercharge/[email protected]
with:
redis-version: 6

- name: add permission to gradlew
run: chmod +x ./gradlew
shell: bash

- name: generate docs
run: ./gradlew asciidoctor
shell: bash

- name: Deploy to Netlify
uses: nwtgck/[email protected]
with:
publish-dir: './build/docs/asciidoc'
production-branch: dev
github-token: ${{ secrets.PRIVATE_TOKEN }}
deploy-message: 'Deploy from GitHub Actions'
enable-pull-request-comment: false
enable-commit-comment: false
overwrites-pull-request-comment: false
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
timeout-minutes: 1
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,7 @@ out/

### DS_Store ###
**/.DS_Store


### Yml ###
src/main/resources/*.yml
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "backend-config"]
path = backend-config
url = https://github.com/SW13-Monstera/backend-config.git
1 change: 1 addition & 0 deletions backend-config
Submodule backend-config added at 5113e3
39 changes: 38 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ buildscript {
plugins {
id("org.springframework.boot") version "2.7.1"
id("io.spring.dependency-management") version "1.0.11.RELEASE"
id("org.asciidoctor.convert") version "1.5.8"
id("org.asciidoctor.jvm.convert") version "3.3.2"
kotlin("jvm") version "1.6.21"
kotlin("plugin.spring") version "1.6.21"
kotlin("plugin.jpa") version "1.6.21"
Expand Down Expand Up @@ -64,6 +64,7 @@ dependencies {
kapt("com.querydsl:querydsl-apt:$querydslVersion:jpa")
kapt("org.springframework.boot:spring-boot-configuration-processor")
annotationProcessor("org.springframework.boot:spring-boot-configuration-processor")
testImplementation("org.springframework.restdocs:spring-restdocs-asciidoctor")
}

idea {
Expand All @@ -89,9 +90,45 @@ tasks.test {
outputs.dir(snippetsDir)
}

tasks.register("copyYml", Copy::class) {
copy {
from("./backend-config")
include("*.yml")
into("src/main/resources")
}
}

tasks.asciidoctor {
dependsOn(tasks.getByName("copyYml"))
inputs.dir(snippetsDir)
dependsOn(tasks.test)
doFirst { // 2
delete("src/main/resources/static/docs")
}
}

tasks.register("copyHTML", Copy::class) { // 3
dependsOn(tasks.asciidoctor)
destinationDir = file(".")
from(tasks.asciidoctor.get().outputDir) {
into("src/main/resources/static/docs")
}
}

tasks.bootRun {
dependsOn(tasks.getByName("copyYml"))
}

tasks.build { // 4
dependsOn(tasks.getByName("copyYml"))
dependsOn(tasks.getByName("copyHTML"))
}

tasks.bootJar { // 5
dependsOn(tasks.asciidoctor)
from(tasks.asciidoctor.get().outputDir) {
into("BOOT-INF/classes/static/docs")
}
}

allOpen {
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading