Skip to content

Commit

Permalink
[build] fix deployment of documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
fab1an committed Sep 14, 2023
1 parent 8a02a24 commit d285733
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions .github/workflows/build-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- master
- build/test-deployment-of-versions

permissions:
contents: write
Expand All @@ -23,7 +24,7 @@ jobs:
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/setup-java@v3
with:
Expand All @@ -37,37 +38,39 @@ jobs:
- name: Build documentation
run: ./gradlew dokkaHtml

- name: Set env.VERSION from json
run: |
echo "VERSION=$(cat ./build/dokka/html/version.json | jq -r '.version')" >> "$GITHUB_ENV"
- uses: actions/configure-pages@v3
if: ${{ !contains(env.VERSION, '-SNAPSHOT') }}

- uses: actions/upload-pages-artifact@v1
if: ${{ !contains(env.VERSION, '-SNAPSHOT') }}
with:
path: 'build/dokka/html'

- name: Deploy to Documentation GitHub Pages
- uses: actions/deploy-pages@v2
if: ${{ !contains(env.VERSION, '-SNAPSHOT') }}
id: deployment
uses: actions/deploy-pages@v1

- name: Delete directory ./build/dokka/html/older
run: rm -Rf ./build/dokka/html/older

- name: Set VERSION from json
- name: Cleanup, archive and commit documenation
if: ${{ !contains(env.VERSION, '-SNAPSHOT') }}
run: |
echo "VERSION=$(cat ./build/dokka/html/version.json | jq -r '.version')" >> "$GITHUB_ENV"
rm -Rf ./build/dokka/html/older
- name: Archive documentation
run: |
# Archive documentation
rm -Rf "./documentation/${{env.VERSION}}"
mv ./build/dokka/html "./documentation/${{env.VERSION}}"
rm -Rf ./documentation/*-SNAPSHOT
- name: Commit documentation
run: |
# setup the username and email
# Commit documentation
## setup the username and email
git config user.name "GitHub Actions"
git config user.email "<>"
# Stage the file, commit and push
## Stage the file, commit and push
git add documentation
git commit -m "[ci-commit] [documentation] updated documentation for ${{env.VERSION}}" || true
git push origin master

0 comments on commit d285733

Please sign in to comment.