butiran

repos separation

· 3 mins read · edit

renaming

visiting

revising

  • 2029 Finally it end but without no full understanding.
  • Content of hugo.yml in the private repo
    name: Deploy Hugo site to public "blog" repo
    
    on:
      push:
        branches: ["main"]
      workflow_dispatch:
    
    permissions:
      contents: write
    
    concurrency:
      group: "pages"
      cancel-in-progress: false
    
    defaults:
      run:
        shell: bash
    
    jobs:
      build:
        runs-on: ubuntu-latest
        env:
          HUGO_VERSION: 0.146.4
        steps:
          - name: Install Hugo CLI
            run: |
              wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
              && sudo dpkg -i ${{ runner.temp }}/hugo.deb
    
          - name: Install Dart Sass
            run: sudo snap install dart-sass
    
          - name: Checkout private source repo
            uses: actions/checkout@v4
            with:
              submodules: recursive
    
          - name: Install Node.js dependencies
            run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true"
    
          - name: Build with Hugo
            env:
              HUGO_CACHEDIR: ${{ runner.temp }}/hugo_cache
              HUGO_ENVIRONMENT: production
            run: |
                REPO_NAME="butiran"
                BASE_URL="https://${{ github.repository_owner }}.github.io/${REPO_NAME}/"
                hugo --minify --baseURL "$BASE_URL"
    
          - name: Upload public folder as artifact
            uses: actions/upload-artifact@v4
            with:
              name: site
              path: public
    
      deploy:
        runs-on: ubuntu-latest
        needs: build
        steps:
          - name: Download built site
            uses: actions/download-artifact@v4
            with:
              name: site
              path: public
    
          - name: Clone public repo
            run: |
              git clone https://${{ secrets.BUTIRAN_DEPLOY_SECRET }}@github.com/dudung/butiran.git deploy_repo
    
              cd deploy_repo
    
              # Make sure public folder exists
              mkdir -p public
              mkdir -p docs
    
              # Clean old build
              rm -rf docs/*
    
              # Copy new build into /public
              cp -r ../public/* docs/
    
              # Optional: keep README and LICENSE untouched
              git config user.name "github-actions[bot]"
              git config user.email "github-actions[bot]@users.noreply.github.com"
    
              git add docs
              git commit -m "Update Hugo site in /public" || echo "No changes to commit"
              git push
  • 2023 Consider it done.

triggering

  • 2042 Use trigger action 1
    git tag deploy-2025-10-11
    git push origin deploy-2025-10-11
  • 2059 Test it. Ok.
  • 2110 Resuse single tag
    git tag -f deploy-now
    git push origin deploy-now -f
  • 2116 Tested and ok.
    • Use to force GitHub Pages deployment.
       git tag -f deploy-now && git push origin deploy-now -f
    • Commit and push do not trigger the deployment.

notes

  • Discussion and instructions are availabe to read 2 and 3.
  • It is observed on 24-oct-2025 that trigger action is still working but not directly activated after push. It requires about a minute or two to hapen. Cause is still unknown. Previously, it is called several times to activate it, which is actually simply the time required by the first call. Finally, tested on 0124 and observed on 0126.

refs


  1. GPT-5, “Trigger action by commit message”, ChatGPT, 11 Oct 2025, url https://chatgpt.com/share/68ea5f2f-4bb0-800a-a405-7810dce5711c [20251011]. ↩︎

  2. GPT-5, “Private blog source setup”, ChatGPT, 11 Oct 2025, url https://chatgpt.com/share/68ea33c9-762c-800a-b0cc-7b3b7ce35066 [20251011]. ↩︎

  3. GPT-5, “Deploy Hugo to public repo”, ChatGPT, 11 Oct 2025, url https://chatgpt.com/share/68ea5cd5-a258-800a-bb97-d3fd4a4ac72c [20251011]. ↩︎