-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (34 loc) · 1.35 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: build
on: [ push, pull_request, workflow_dispatch ]
permissions:
contents: write
env:
GRADLE_OPTS: "-Dorg.gradle.daemon=false -Dkotlin.incremental=false"
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions/[email protected]
with:
distribution: 'zulu'
java-version: 19
- run: ./gradlew build check dokkaHtml
- run: ./gradlew publish
if: ${{ github.ref == 'refs/heads/main' && github.repository == 'alexandrepiveteau/kotlin-graphs' }}
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
- name: Deploy docs
if: ${{ github.ref == 'refs/heads/main' && github.repository == 'alexandrepiveteau/kotlin-graphs' }}
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
run: |
cd build/dokka/html
git init . && git branch -m dokka
git add .
git config user.name "${{github.actor}}"
git config user.email "${{github.actor}}@users.noreply.github.com"
git commit -m "🚀 Publish documentation"
git remote add origin https://x-access-token:[email protected]/${{github.repository}}
git push -u origin dokka --force