kitgit

tirbofish/dropbear · commit

612fa2a29732c1da55bee69fd533057dd794c255

fix doc action

Unverified

tk <4tkbytes@pm.me> · 2025-10-09 12:39

view full diff

diff --git a/.github/workflows/dokka_docs.yaml b/.github/workflows/dokka_docs.yaml
index babc2b1..2aa4c98 100644
--- a/.github/workflows/dokka_docs.yaml
+++ b/.github/workflows/dokka_docs.yaml
@@ -1,16 +1,22 @@
-name: Deploy Documentation
+name: Deploy Dokka Documentation
 
 on:
   push:
     branches:
-      - main
-  workflow_dispatch:
+      - main  # Change to your default branch if different
+  workflow_dispatch:  # Allows manual trigger
 
 permissions:
-  contents: write
+  contents: read
+  pages: write
+  id-token: write
+
+concurrency:
+  group: "pages"
+  cancel-in-progress: false
 
 jobs:
-  deploy-docs:
+  build:
     runs-on: ubuntu-latest
 
     steps:
@@ -22,21 +28,30 @@ jobs:
         with:
           java-version: '21'
           distribution: 'temurin'
-          cache: 'gradle'
+          cache: gradle
 
       - name: Grant execute permission for gradlew
         run: chmod +x gradlew
 
-      - name: Stop GitHub from bothering me about .env
-        run: touch .env
+      - name: Setup Pages
+        uses: actions/configure-pages@v5
 
-      - name: Generate documentation
+      - name: Generate Dokka documentation
         run: ./gradlew dokkaGenerate
 
-      - name: Deploy to GitHub Pages
-        uses: peaceiris/actions-gh-pages@v3
+      - name: Upload artifact
+        uses: actions/upload-pages-artifact@v4
         with:
-          github_token: ${{ secrets.GITHUB_TOKEN }}
-          publish_dir: ./build/dokka/html
-          publish_branch: gh-pages
-          commit_message: 'Deploy documentation from ${{ github.sha }}'
\ No newline at end of file
+          path: ./build/dokka/html
+
+  deploy:
+    environment:
+      name: github-pages
+      url: ${{ steps.deployment.outputs.page_url }}
+    runs-on: ubuntu-latest
+    needs: build
+
+    steps:
+      - name: Deploy to GitHub Pages
+        id: deployment
+        uses: actions/deploy-pages@v4
\ No newline at end of file