Created
September 4, 2022 04:15
-
-
Save aadimator/5125fbd8a51b1dd13ba608fe37aacfd4 to your computer and use it in GitHub Desktop.
GH Action configuration file to automatically publish my Obsidian Vault using Quartz
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish | |
on: | |
push: | |
branches: [master] | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
steps: | |
- name: Checkout quartz template repo | |
uses: actions/checkout@v2 | |
with: | |
repository: aadimator/quartz | |
path: ./ | |
- name: Checkout notes | |
uses: actions/checkout@v2 | |
with: | |
path: raw_notes | |
- name: Get latest obsidian-export | |
uses: dsaltares/fetch-gh-release-asset@master | |
with: | |
repo: 'aadimator/obsidian-export' | |
file: 'obsidian-export' | |
- name: Run obsidian-export script | |
run: | | |
ls | |
chmod +x obsidian-export | |
mkdir ./content/notes -p | |
./obsidian-export raw_notes ./content/notes --hard-linebreaks --no-recursive-embeds --embed-info --hugo-frontmatter --retain-wikilinks --flat | |
continue-on-error: true | |
- name: Housekeeping | |
run: | | |
rm -rf raw_notes | |
rm ./obsidian-export | |
mv content/notes/Index.md content/_index.md | |
mv content/notes/00\ Meta content/ | |
- name: Build Link Index | |
uses: aadimator/[email protected] | |
with: | |
index: true | |
input: content | |
output: assets/indices | |
root: . | |
- name: Setup Hugo | |
uses: peaceiris/actions-hugo@v2 | |
with: | |
hugo-version: 'latest' | |
extended: true | |
- name: Build | |
run: | | |
hugo --minify --gc | |
mv config.toml ./public | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./public | |
publish_branch: gh-pages |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment