Skip to content

Commit

Permalink
workflow(docs): fix missing docs output
Browse files Browse the repository at this point in the history
  • Loading branch information
jhdcruz committed Jul 31, 2023
1 parent 0f70e66 commit c1f5a11
Show file tree
Hide file tree
Showing 623 changed files with 51,576 additions and 3,575 deletions.
1 change: 1 addition & 0 deletions .github/workflows/docs/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Manual publishing of docs.
109 changes: 109 additions & 0 deletions .github/workflows/docs/docs-core.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: docs / core

on:
workflow_dispatch:
workflow_call:

permissions:
contents: write
pages: write
id-token: write

env:
GRADLE_OPTS: -Dorg.gradle.jvmargs="-XX:MaxMetaspaceSize=4g"
JDK_VERSION: 19

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up JDK ${{ env.JDK_VERSION }}
uses: actions/setup-java@v3
with:
java-version: ${{ env.JDK_VERSION }}
distribution: temurin

- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1

- name: Dokka build
uses: gradle/gradle-build-action@v2
with:
arguments: kipher-core:dokkaHtml

- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: docs
path: ./docs/api/kipher-core
if-no-files-found: error

push:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

# remove previous versions, new version contains the old ones
- name: Remove previous versions
run: rm -rf docs/api/kipher-core

- name: Download artifact
uses: actions/download-artifact@v3
with:
name: docs
path: ./docs/api

- name: Remove snapshots version
run: |
cd ./docs/api/kipher-core
rm -rf **/older/*-SNAPSHOT
- name: Commit latest docs
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add -f docs/api/kipher-core
git commit -m "docs(api): generate docs for kipher-core [skip-ci]"
- name: Push to repository
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
directory: ./docs/api/kipher-core

deploy:
runs-on: ubuntu-latest
permissions:
contents: write
deployments: write
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Download artifact
uses: actions/download-artifact@v3
with:
name: docs
path: ./docs/api

- name: Get api docs output directory
id: docs
shell: bash
run: |
cd docs/api/kipher-core
echo "api=$(ls -d */ | head -n 1)" >> $GITHUB_OUTPUT
- name: Publish to cloudflare pages
uses: cloudflare/pages-action@1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: kipher-core
directory: docs/api/kipher-core/${{ steps.docs.outputs.api }}
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
109 changes: 109 additions & 0 deletions .github/workflows/docs/docs-digest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: docs

on:
workflow_dispatch:
workflow_call:

permissions:
contents: write
pages: write
id-token: write

env:
GRADLE_OPTS: -Dorg.gradle.jvmargs="-XX:MaxMetaspaceSize=4g"
JDK_VERSION: 19

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up JDK ${{ env.JDK_VERSION }}
uses: actions/setup-java@v3
with:
java-version: ${{ env.JDK_VERSION }}
distribution: temurin

- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1

- name: Dokka build
uses: gradle/gradle-build-action@v2
with:
arguments: kipher-digest:dokkaHtml

- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: docs
path: ./docs/api/kipher-digest
if-no-files-found: error

push:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

# remove previous versions, new version contains the old ones
- name: Remove previous versions
run: rm -rf docs/api/kipher-digest

- name: Download artifact
uses: actions/download-artifact@v3
with:
name: docs
path: ./docs/api

- name: Remove snapshots version
run: |
cd ./docs/api/kipher-digest
rm -rf **/older/*-SNAPSHOT
- name: Commit latest docs
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add -f docs/api/kipher-digest
git commit -m "docs(api): generate docs for kipher-digest [skip-ci]"
- name: Push to repository
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
directory: ./docs/api/kipher-digest

deploy:
runs-on: ubuntu-latest
permissions:
contents: write
deployments: write
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Download artifact
uses: actions/download-artifact@v3
with:
name: docs
path: ./docs/api

- name: Get api docs output directory
id: docs
shell: bash
run: |
cd docs/api/kipher-digest
echo "api=$(ls -d */ | head -n 1)" >> $GITHUB_OUTPUT
- name: Publish to cloudflare pages
uses: cloudflare/pages-action@1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: kipher-digest
directory: docs/api/kipher-digest/${{ steps.docs.outputs.api }}
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
109 changes: 109 additions & 0 deletions .github/workflows/docs/docs-mac.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: docs

on:
workflow_dispatch:
workflow_call:

permissions:
contents: write
pages: write
id-token: write

env:
GRADLE_OPTS: -Dorg.gradle.jvmargs="-XX:MaxMetaspaceSize=4g"
JDK_VERSION: 19

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up JDK ${{ env.JDK_VERSION }}
uses: actions/setup-java@v3
with:
java-version: ${{ env.JDK_VERSION }}
distribution: temurin

- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1

- name: Dokka build
uses: gradle/gradle-build-action@v2
with:
arguments: kipher-mac:dokkaHtml

- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: docs
path: ./docs/api/kipher-mac
if-no-files-found: error

push:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

# remove previous versions, new version contains the old ones
- name: Remove previous versions
run: rm -rf docs/api/kipher-mac

- name: Download artifact
uses: actions/download-artifact@v3
with:
name: docs
path: ./docs/api

- name: Remove snapshots version
run: |
cd ./docs/api/kipher-mac
rm -rf **/older/*-SNAPSHOT
- name: Commit latest docs
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add -f docs/api/kipher-mac
git commit -m "docs(api): generate docs for kipher-mac [skip-ci]"
- name: Push to repository
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
directory: ./docs/api/kipher-mac

deploy:
runs-on: ubuntu-latest
permissions:
contents: write
deployments: write
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Download artifact
uses: actions/download-artifact@v3
with:
name: docs
path: ./docs/api

- name: Get api docs output directory
id: docs
shell: bash
run: |
cd docs/api/kipher-mac
echo "api=$(ls -d */ | head -n 1)" >> $GITHUB_OUTPUT
- name: Publish to cloudflare pages
uses: cloudflare/pages-action@1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: kipher-mac
directory: docs/api/kipher-mac/${{ steps.docs.outputs.api }}
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
Loading

0 comments on commit c1f5a11

Please sign in to comment.