Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get rid of gh-pages branch #815

Closed
wants to merge 10 commits into from
45 changes: 22 additions & 23 deletions .github/workflows/docs-ci.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
# This workflow will build and deploy docs to GitHub Pages whenever something is pushed to the default branch
name: Build docs

name: Docs

on: push # but only to default branch, see if below
on:
push:
branches: [ "main" ]

# Gives the workflow permissions to clone the repo and create a page deployment
permissions:
contents: write
id-token: write
pages: write

jobs:
docs:
name: Build and deploy docs
build-job:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
concurrency: # Allow one concurrent deployment
group: pages
cancel-in-progress: true
env:
GITHUB_TAG_NAME: ${{ github.event.release.tag_name }}
GITHUB_BRANCH_NAME: ${{ github.ref }}
steps:
- uses: actions/checkout@v3
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
Expand All @@ -28,12 +26,13 @@ jobs:
- name: Build docs with Gradle
uses: gradle/gradle-build-action@v2
with:
arguments: --stacktrace --info dokkaHtmlMultiModule
- name: Deploy docs to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
arguments: dokkaHtmlMultiModule
- name: Setup Pages
uses: actions/configure-pages@v2
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
folder: build/dokka/htmlMultiModule
branch: gh-pages
git-config-name: GitHub Actions
git-config-email: actions@github.com
commit-message: Update docs
path: build/dokka/htmlMultiModule
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1