mirror of
https://github.com/jlengrand/detekt.git
synced 2026-03-10 08:11:23 +00:00
111 lines
2.8 KiB
YAML
111 lines
2.8 KiB
YAML
name: Deploy Website
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
build-detekt-docs:
|
|
if: github.repository == 'detekt/detekt'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout Repo
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Setup Java
|
|
uses: actions/setup-java@v3
|
|
with:
|
|
java-version: 17
|
|
distribution: 'temurin'
|
|
|
|
- name: Build Detekt Documentation
|
|
uses: gradle/gradle-build-action@v2
|
|
with:
|
|
arguments: :detekt-generator:generateDocumentation
|
|
|
|
- name: Upload Generated Rules documentation
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: detekt-generated-docs
|
|
path: docs/pages/documentation/
|
|
|
|
- name: Upload KDoc documentation
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: detekt-kdoc
|
|
path: docs/pages/kdoc/
|
|
|
|
- name: Upload generated CLI options documentation
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: detekt-cli-options-docs
|
|
path: docs/pages/gettingstarted/cli-options.md
|
|
|
|
build-website:
|
|
permissions:
|
|
contents: write # for JamesIves/github-pages-deploy-action to push changes in repo
|
|
needs: build-detekt-docs
|
|
runs-on: ubuntu-latest
|
|
container: jekyll/builder
|
|
steps:
|
|
- name: Checkout Repo
|
|
uses: actions/checkout@v3
|
|
|
|
- uses: actions/cache@v3
|
|
with:
|
|
path: docs/vendor/bundle
|
|
key: cache-gems-${{ hashFiles('**/Gemfile.lock') }}
|
|
restore-keys: cache-gems-
|
|
|
|
- name: Unzipping Generated Rules documentation
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
name: detekt-generated-docs
|
|
path: docs/pages/documentation/
|
|
|
|
- name: Unzipping KDoc documentation
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
name: detekt-kdoc
|
|
path: docs/pages/kdoc/
|
|
|
|
- name: Unzipping generated CLI options documentation
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
name: detekt-cli-options-docs
|
|
path: docs/pages/gettingstarted/
|
|
|
|
- name: Display structure of files
|
|
run: ls -R
|
|
working-directory: docs/
|
|
|
|
- name: Create Directories
|
|
run: |
|
|
mkdir _site/
|
|
mkdir -p vendor/bundle/
|
|
chmod -R 777 _site/
|
|
chmod -R 777 vendor/
|
|
touch Gemfile.lock
|
|
chmod a+w Gemfile.lock
|
|
working-directory: docs/
|
|
|
|
- name: Install Ruby Dependencies
|
|
working-directory: docs/
|
|
run: |
|
|
bundle config path vendor/bundle
|
|
bundle install --jobs 4 --retry 3
|
|
|
|
- name: Build the Jekyll Website
|
|
run: bundle exec jekyll build -d _site/
|
|
working-directory: docs/
|
|
|
|
- name: Deploy Github Pages
|
|
uses: JamesIves/github-pages-deploy-action@v4
|
|
with:
|
|
branch: gh-pages
|
|
folder: docs/_site/
|