🌱Aadam's Garden

Search

Search IconIcon to open search

Zolidian

Last updated Jun 24, 2022

# Workflow

# Scripts

During development, I use the following command from the zolidian directory to update the content of the site:

1
rm -rf content && mkdir content && obsidian-export --frontmatter=never --hard-linebreaks --no-recursive-embeds ../../notes content && python convert.py

To start the preview:

1
zola serve

# Github Action

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# This is a basic workflow to help you get started with Actions

name: Publish

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
  push:
    branches: [master]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
  # This workflow contains a single job called "build"
  deploy:
    # The type of runner that the job will run on
    runs-on: ubuntu-latest

    concurrency:
      group: ${{ github.workflow }}-${{ github.ref }}

    # Steps represent a sequence of tasks that will be executed as part of the job
    steps:
      # - name: Remove everything
      #   run: rm -rf .

      - name: Checkout zola template repo
        uses: actions/checkout@v2
        with:
          repository: aadimator/zolidian
          path: ./

      - name: Checkout notes
        uses: actions/checkout@v2
        with:
          path: raw_notes

      - name: Run obsidian-export script
        run: |
          ls
          chmod +x export.bin
          mkdir ./content
          ./export.bin --frontmatter=never --hard-linebreaks --no-recursive-embeds raw_notes ./content          

      - run: rm -rf raw_notes

      - name: Set up Python 3.8
        uses: actions/setup-python@v2
        with:
          # Semantic version range syntax or exact version of a Python version
          python-version: "3.8"
          # Optional - x64 or x86 architecture, defaults to x64
          architecture: "x64"

      - run: python convert.py

      - name: build_and_deploy
        uses: shalzz/zola-deploy-action@v0.14.1
        env:
          # Target branch
          PAGES_BRANCH: gh-pages
          # Provide personal access token
          TOKEN: ${{ secrets.TOKEN }}

      # - name: Checkout theme repo
      #   uses: actions/checkout@v2
      #   with:
      #     repository: aadimator/obsidian-digital-garden
      #     path: ./

      # - name: Checkout notes
      #   uses: actions/checkout@v2
      #   with:
      #     path: raw_notes

      # - name: Setup Cargo
      #   uses: actions-rs/toolchain@v1
      #   with:
      #     toolchain: stable

      # - name: Cargo install obsidian-export
      #   uses: actions/checkout@v2
      #   with:
      #     repository: aadimator/obsidian-export
      #     path: obsidian-export

      # - run: cargo install --path obsidian-export
      # - run: mkdir content
      # - run: obsidian-export raw_notes content/ --frontmatter=always --hard-linebreaks
      # - run: rm -rf raw_notes
      # - run: rm -rf obsidian-export
      # - run: ls

      # - name: Deploy to GitHub Pages
      #   uses: peaceiris/actions-gh-pages@v3
      #   with:
      #     github_token: ${{ secrets.GITHUB_TOKEN }}
      #     publish_dir: ./

    # - name: Checkout python script
    #   uses: actions/checkout@v2
    #   with:
    #     repository: aadimator/auto-front-matter
    #     path: auto-fm

    # - name: Set up Python 3.9.6
    #   uses: actions/setup-python@v2
    #   with:
    #     # Semantic version range syntax or exact version of a Python version
    #     python-version: '3.9.6'
    #     # Optional - x64 or x86 architecture, defaults to x64
    #     architecture: 'x64'

    # - name: Install dependencies
    #   run: |
    #     python -m pip install --upgrade pip
    #     pip install -r auto-fm/requirements.txt

    # - name: Run Python script
    #   run: |
    #     cd raw_notes
    #     python ../auto-fm/main.py --output ../_notes
    #     cd ..
    #     rm -rf raw_notes
    #     rm -rf auto-fm

    # # Use GitHub Actions' cache to shorten build times and decrease load on servers
    # - uses: actions/cache@v1
    #   with:
    #     path: vendor/bundle
    #     key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
    #     restore-keys: |
    #       ${{ runner.os }}-gems-

    # - uses: helaili/jekyll-action@2.0.1
    #   env:
    #     JEKYLL_PAT: ${{ secrets.JEKYLL_PAT }}

    # # Runs a single command using the runners shell
    # - name: Run a one-line script
    #   run: ls $GITHUB_WORKSPACE

    # # Runs a set of commands using the runners shell
    # - name: Run a multi-line script
    #   run: |
    #     ls $GITHUB_WORKSPACE/_notes
    #     echo test, and deploy your project.