Commit dae844e

benny-dou <60535774+benny-dou@users.noreply.github.com>
2025-12-07 13:18:10
build(html): build and deploy static HTML site
1 parent 070f8aa
Changed files (1)
.github
workflows
.github/workflows/docker.yml
@@ -28,6 +28,8 @@ jobs:
     steps:
       - name: Checkout
         uses: actions/checkout@main
+        with:
+          fetch-depth: 0
 
       - name: Docker meta
         id: meta
@@ -55,7 +57,7 @@ jobs:
           password: ${{ secrets.GITHUB_TOKEN }}
           registry: ghcr.io
 
-      - name: Build
+      - name: Build Docker
         uses: docker/build-push-action@master
         with:
           context: .
@@ -68,3 +70,34 @@ jobs:
           push: true
           tags: ${{ steps.meta.outputs.tags }}
           labels: ${{ steps.meta.outputs.labels }}
+
+      # Build Static HTML
+      - uses: actions/cache@v4
+        id: cache-gitmal
+        with:
+          path: |
+            ~/.local/bin/gitmal
+          key: gitmal
+
+      - name: Install gitmal
+        if: steps.cache-gitmal.outputs.cache-hit != 'true'
+        shell: bash
+        run: |
+          if [ ! -x "$HOME/.local/bin/gitmal" ]; then
+          mkdir -p ~/.local/bin
+          curl -fsSL -o "$HOME/.local/bin/gitmal" "https://github.com/antonmedv/gitmal/releases/download/v1.0.0/gitmal_linux_amd64"
+          chmod +x "$HOME/.local/bin/gitmal"
+          fi
+
+      - name: Build Static HTML
+        shell: bash
+        run: |
+          ~/.local/bin/gitmal -branches main -minify -theme tokyonight-night -name bennybot -output output
+
+      - name: Push HTML
+        uses: JamesIves/github-pages-deploy-action@v4
+        with:
+          branch: gh-pages
+          folder: ./output
+          single-commit: true
+          commit-message: ${{ github.event.head_commit.message }}