Skip to content

Commit

Permalink
Test docs.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamGrzybkowski committed Dec 3, 2024
1 parent 3e1796f commit bacdf42
Showing 1 changed file with 33 additions and 19 deletions.
52 changes: 33 additions & 19 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ name: Build and Deploy API Documentation

on:
push:
tags:
# Match 1.0.0 but not 1.0.0-rc1 or other suffixes
- '[1-9]+.[0-9]+.[0-9]+'
branches:
- adam/github_actions_test

jobs:
generate_docs:
Expand All @@ -14,32 +13,47 @@ jobs:
contents: write

steps:
- uses: actions/checkout@v3
- name: Checkout the branch with the latest code
uses: actions/checkout@v3
with:
fetch-depth: 0
# ref: ${{ github.ref_name }}
ref: 'adam/github_actions_test'
path: 'code'
- name: Checkout the branch with the docs
uses: actions/checkout@v4
with:
ref: 'docs'
path: 'docs'
- name: Print the current directory
run: ls
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Copy docs to docs/dokka directory
- name: Copy docs to the code directory
run: |
git fetch origin docs:docs
git checkout docs
mkdir -p docs/dokka || true
cp -R current/ docs/dokka/current
cp -R history/ docs/dokka/history
git checkout ${{ github.ref_name }}
cp -R ./docs/current/ ./code/docs/dokka/current
cp -R ./docs/history/ ./code/docs/dokka/history
- name: Generate Dokka Documentation
run: ./gradlew dokkaHtmlMultiModule
- name: Update Docs Branch
working-directory: ./code
run: |
git tag -a 2.2.0 -m "Test"
./gradlew dokkaHtmlMultiModule
- name: Update Docs
run: |
cp -R code/docs/dokka/history docs/
cp -R code/docs/dokka/current current/
- name: Push updated docs
working-directory: ./docs
run: |
git checkout docs
cp -R docs/dokka/history .
cp -R docs/dokka/current .
git add history
git add current
git config user.name github-actions
git config user.email [email protected]
git commit -m "Update API documentation for ${{ github.ref_name }}"
git push origin docs
# git commit -m "Update API documentation for ${{ github.ref_name }}"
git commit -m "Update API documentation for VERSION_HERE"
#git push origin docs
- name: Print the docs directory
working-directory: ./docs/history
run: ls

0 comments on commit bacdf42

Please sign in to comment.