Skip to content

Commit

Permalink
refactor: docs 액션에서 allure 문서 배포하도록 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
belljun3395 committed Dec 20, 2024
1 parent db94f22 commit b3bf5ca
Showing 1 changed file with 34 additions and 26 deletions.
60 changes: 34 additions & 26 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and Publish Dokka Documentation
name: Build and Publish Allure Documentation

on:
pull_request:
Expand All @@ -8,40 +8,48 @@ on:
permissions: write-all

jobs:
dokka:
docs:
runs-on: ubuntu-latest
steps:
# 1. Checkout the code
- uses: actions/checkout@v4

# 2. Set up JDK
- name: Set up JDK
uses: actions/setup-java@v4
- name: Set up JDK 18
uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 17
java-version: '18'
distribution: 'temurin'

# 3. Run dokkaHtmlMultiModule
- name: Generate Dokka Documentation
run: ./gradlew dokkaHtmlMultiModule
- name: Grant execute permission for gradlew
run: chmod +x gradlew

# 4. Checkout gh-pages branch to publish documentation
- name: Checkout gh-pages
uses: actions/checkout@v4
with:
ref: gh-pages # Use the `gh-pages` branch
path: gh-pages # Specify the path where `gh-pages` branch will be checked out

# 5. Copy generated documentation to gh-pages directory
- name: Copy Dokka Documentation
- name: Jooq Code Generation
run: |
rm -rf gh-pages/* # Clear existing files
cp -R build/dokka/htmlMultiModule/* gh-pages/ # Copy the newly generated documentation
./gradlew jooqCodegenAll
- name: Generate Allure Results
run: ./gradlew api:test

# 6. Publish documentation to GitHub Pages
- name: Publish Documentation
uses: peaceiris/actions-gh-pages@v4
- name: Load test report history
uses: actions/checkout@v3
if: always()
continue-on-error: true
with:
ref: gh-pages
path: gh-pages

- name: Build test report
uses: simple-elf/[email protected]
if: always()
with:
gh_pages: gh-pages
allure_history: allure-history
allure_results: build/allure-results
subfolder: api

- name: Publish test report
uses: peaceiris/actions-gh-pages@v3
if: always()
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: gh-pages
publish_dir: allure-history

0 comments on commit b3bf5ca

Please sign in to comment.