aboutsummaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorvmishenev <vad-mishenev@yandex.ru>2021-07-28 14:57:38 +0300
committervmishenev <vad-mishenev@yandex.ru>2021-07-28 19:11:50 +0300
commitf03083d7534209ad94dc3c4d7afd17f58e58127d (patch)
tree8160e6e8d376fc16ad559cfa59048c5447d2e2bd /.github
parent2cd95b0828518dde751d039f4456dcf93e04dfc1 (diff)
downloaddokka-f03083d7534209ad94dc3c4d7afd17f58e58127d.tar.gz
dokka-f03083d7534209ad94dc3c4d7afd17f58e58127d.tar.bz2
dokka-f03083d7534209ad94dc3c4d7afd17f58e58127d.zip
Migrate Dokka examples to Dokka repo (KT-47798) (#2030)
* Migrate Dokka examples to Dokka repo (KT-47798) * Configure workflow of examples checking * Add workflow to deploy examples
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/dokka-examples.yml119
-rw-r--r--.github/workflows/gh-pages-examples.yml59
2 files changed, 178 insertions, 0 deletions
diff --git a/.github/workflows/dokka-examples.yml b/.github/workflows/dokka-examples.yml
new file mode 100644
index 00000000..35fc5f92
--- /dev/null
+++ b/.github/workflows/dokka-examples.yml
@@ -0,0 +1,119 @@
+name: Build examples
+
+on: pull_request
+
+jobs:
+ build:
+ strategy:
+ matrix:
+ projects: [
+ examples/gradle/dokka-gradle-example,
+ examples/gradle/dokka-kotlinAsJava-example,
+ examples/gradle/dokka-library-publishing-example,
+ examples/gradle/dokka-multimodule-example,
+ examples/gradle/dokka-multiplatform-example,
+ examples/gradle/dokka-customFormat-example
+ ]
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - uses: dorny/paths-filter@v2
+ id: filter
+ with:
+ filters: |
+ examples_changed:
+ - '${{ matrix.projects }}/**'
+ - uses: actions/setup-java@v1
+ with:
+ java-version: 11
+ - run: ./gradlew build --no-daemon --stacktrace
+ working-directory: ${{ matrix.projects }}
+ if: steps.filter.outputs.examples_changed == 'true'
+
+ run-dokka-html:
+ strategy:
+ matrix:
+ projects: [
+ examples/gradle/dokka-gradle-example,
+ examples/gradle/dokka-kotlinAsJava-example,
+ examples/gradle/dokka-library-publishing-example,
+ examples/gradle/dokka-multiplatform-example,
+ examples/gradle/dokka-customFormat-example
+ ]
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - uses: dorny/paths-filter@v2
+ id: filter
+ with:
+ filters: |
+ examples_changed:
+ - '${{ matrix.projects }}/**'
+ - uses: actions/setup-java@v1
+ with:
+ java-version: 11
+ - run: ./gradlew dokkaHtml --no-daemon --stacktrace
+ working-directory: ${{ matrix.projects }}
+ if: steps.filter.outputs.examples_changed == 'true'
+
+ run-dokka-publishing:
+ strategy:
+ matrix:
+ tasks: [dokkaJavadocJar, dokkaHtmlJar]
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - uses: dorny/paths-filter@v2
+ id: filter
+ with:
+ filters: |
+ examples_changed:
+ - 'examples/gradle/dokka-library-publishing-example/**'
+ - uses: actions/setup-java@v1
+ with:
+ java-version: 11
+ - run: ./gradlew ${{ matrix.tasks }} --no-daemon --stacktrace
+ working-directory: examples/gradle/dokka-library-publishing-example
+ if: steps.filter.outputs.examples_changed == 'true'
+
+ run-dokka-gradle-tasks:
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ include:
+ - task: "dokkaCustomFormat"
+ dir: "examples/gradle/dokka-customFormat-example"
+ - task: "dokkaHtmlMultiModule"
+ dir: "examples/gradle/dokka-multimodule-example"
+ steps:
+ - uses: actions/checkout@v2
+ - uses: dorny/paths-filter@v2
+ id: filter
+ with:
+ filters: |
+ examples_changed:
+ - '${{ matrix.dir }}/**'
+ - uses: actions/setup-java@v1
+ with:
+ java-version: 11
+ - run: ./gradlew ${{ matrix.task }} --no-daemon --stacktrace
+ working-directory: ${{ matrix.dir }}
+ if: steps.filter.outputs.examples_changed == 'true'
+
+ run-dokka-maven-example:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - uses: dorny/paths-filter@v2
+ id: filter
+ with:
+ filters: |
+ examples_changed:
+ - 'examples/maven/**'
+ working-directory: examples/maven
+ - uses: actions/setup-java@v1
+ with:
+ java-version: 11
+ - run: mvn compile dokka:dokka
+ working-directory: examples/maven
+ if: steps.filter.outputs.examples_changed == 'true' \ No newline at end of file
diff --git a/.github/workflows/gh-pages-examples.yml b/.github/workflows/gh-pages-examples.yml
new file mode 100644
index 00000000..1931aaa7
--- /dev/null
+++ b/.github/workflows/gh-pages-examples.yml
@@ -0,0 +1,59 @@
+name: Build and deploy examples to GitHub Pages
+
+on:
+ push:
+ branches:
+ - master
+jobs:
+ build-examples:
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ projects: [
+ dokka-gradle-example,
+ dokka-kotlinAsJava-example,
+ dokka-library-publishing-example,
+ dokka-multiplatform-example,
+ dokka-customFormat-example
+ ]
+ steps:
+ - name: Checkout dokka
+ uses: actions/checkout@v2
+ - uses: dorny/paths-filter@v2
+ id: filter
+ with:
+ filters: |
+ examples_changed:
+ - 'examples/gradle/${{ matrix.projects }}/**'
+
+ - uses: actions/setup-java@v1
+ with:
+ java-version: 11
+
+ - name: Build html
+ run: ./gradlew dokkaHtml --no-daemon --stacktrace
+ working-directory: examples/gradle/${{ matrix.projects }}
+ if: steps.filter.outputs.examples_changed == 'true'
+
+ - name: Upload artifact
+ uses: actions/upload-artifact@v2
+ if: steps.filter.outputs.examples_changed == 'true'
+ with:
+ name: ${{ matrix.projects }}
+ path: examples/gradle/${{ matrix.projects }}/build/dokka
+
+
+ deploy-examples:
+ runs-on: ubuntu-latest
+ needs: build-examples
+ steps:
+ - uses: actions/download-artifact@v2
+ with:
+ path: public/examples
+ - name: Deploy
+ uses: peaceiris/actions-gh-pages@v3
+ with:
+ github_token: ${{ secrets.GITHUB_TOKEN }}
+ keep_files: true
+ publish_dir: ./public
+ full_commit_message: Publish examples \ No newline at end of file