Skip to content

Commit

Permalink
[build] testing deployment of pages
Browse files Browse the repository at this point in the history
  • Loading branch information
fab1an committed Sep 14, 2023
1 parent 8a02a24 commit f403b1b
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 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 Down Expand Up @@ -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

0 comments on commit f403b1b

Please sign in to comment.