From f403b1b7349062effac808927bcde799f65ecbbb Mon Sep 17 00:00:00 2001 From: Fabian Zeindl Date: Thu, 14 Sep 2023 06:21:02 +0200 Subject: [PATCH] [build] testing deployment of pages --- .github/workflows/build-master.yml | 33 ++++++++++++++++-------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build-master.yml b/.github/workflows/build-master.yml index 54ed16f..6c8a66a 100644 --- a/.github/workflows/build-master.yml +++ b/.github/workflows/build-master.yml @@ -4,6 +4,7 @@ on: push: branches: - master + - build/test-deployment-of-versions permissions: contents: write @@ -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('-SNAPSHOT', env.VERSION) }} - uses: actions/upload-pages-artifact@v1 + if: ${{ !contains('-SNAPSHOT', env.VERSION) }} with: path: 'build/dokka/html' - - name: Deploy to Documentation GitHub Pages + - uses: actions/deploy-pages@v1 + if: ${{ !contains('-SNAPSHOT', env.VERSION) }} 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 - run: | - echo "VERSION=$(cat ./build/dokka/html/version.json | jq -r '.version')" >> "$GITHUB_ENV" - - - name: Archive documentation + - name: Cleanup, archive and commit documenation + if: ${{ !contains('-SNAPSHOT', env.VERSION) }} run: | + rm -Rf ./build/dokka/html/older + + # 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 -