Gitea

We will be leveraging gitea to create two repo’s:

  • Obsidian Vault: Empty Repo
  • Quartz: Cloned from Public repo With these two repo’s generated we will then setup obsidian to synchronize with the gitea along with an action which will extract the “public” content from the vault to be pushed to the quartz repo.

Process:

  1. Setting Up Quartz Fork

    • Used Gitea’s Migration feature to create a local copy of Quartz
    • Chose not to make it a mirror to allow for customizations
    • Selected https://github.com/jackyzha0/quartz as the source
  2. Creating Build Action

    • Created directory structure: .gitea/workflows/
    • Created build action file in .gitea/workflows/build.yml
      • Checkout code
      • Setup Node.js 20
      • Install dependencies
      • Run Quartz build
      • Commit and push built files
    name: Build Quartz Site
    on:
      push:
        paths-ignore:
          - 'public/**'
    jobs:
      build:
        runs-on: ubuntu-latest
        steps:
          - name: Checkout repository
            uses: actions/checkout@v4
          - name: Setup Node.js
            uses: actions/setup-node@v4
            with:
              node-version: '20'
          - name: Install dependencies and build
            run: |
              npm install
              npm audit fix
              npx quartz build
          - name: Commit and push built site
            run: |
              git config --global user.name "Gitea Actions"
              git config --global user.email "{Insert Email Address}"
              git add public/
              if git status --porcelain | grep .; then
                git commit -m "Build site $(date +'%Y-%m-%d %H:%M:%S')"
                git push origin HEAD
              else
                echo "No changes to commit"
              fi
  3. Setup initial site

  • Pull down repo
  • Build empty site by running same commands in pipeline:
    npm install
    npm audit fix
    npx quartz create
  • Follow the prompts to create an empty Quartz project
  1. Verify build was successful. Run: