fix: background inconsistencies #71
This file contains 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: Deploy Hugo from Obsidian notes | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
publish_job: | |
runs-on: ubuntu-latest | |
name: Publish Obsidian notes to Github pages | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.DWARVES_PAT }} | |
- name: Checkout contents repo | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.DWARVES_PAT }} | |
submodules: 'true' | |
- name: Pull & update submodules recursively | |
run: | | |
git submodule update --init --recursive | |
git submodule update --recursive --remote | |
- name: Commit | |
run: | | |
git config user.email "actions@github.com" | |
git config user.name "GitHub Actions" | |
git add --all | |
git commit -m "chore: update submodules" || echo "No changes to commit" | |
git push | |
- name: Cache cargo plugins | |
id: cache-obsidian-export | |
uses: actions/cache@v1 | |
with: | |
path: ~/.cargo/bin/ | |
key: ${{ runner.os }}-cargo-plugins | |
- name: Install obsidian-export | |
if: steps.cache-obsidian-export.outputs.cache-hit != 'true' | |
uses: actions-rs/install@v0.1 | |
with: | |
crate: obsidian-export | |
version: latest | |
- name: Setup Hugo | |
uses: peaceiris/actions-hugo@v2 | |
with: | |
hugo-version: 'latest' | |
extended: true | |
- name: Create content dir if not exists | |
shell: bash | |
run: mkdir -p ./content | |
- name: Export Vault | |
shell: bash | |
run: obsidian-export ./vault ./content | |
- name: Build Hugo | |
shell: bash | |
run: hugo -D -E -F --minify | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
if: ${{ github.ref == 'refs/heads/main' }} | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./public |