Obsidian Export #571
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: Obsidian Export | |
on: | |
schedule: | |
- cron: '0 0 * * *' | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
steps: | |
- name: Setup Github Credentials | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.GENERAL_PAT }} | |
- name: Setup Obsidian Export | |
run: | | |
wget https://github.com/zoni/obsidian-export/releases/download/v22.11.0/obsidian-export_Linux-x86_64.bin -O obsidian-export | |
chmod +x obsidian-export | |
sudo mv obsidian-export /usr/bin/obsidian-export | |
- name: Clone Knowledge Base | |
run: | | |
git clone https://github.com/okwilkins/knowledge-system | |
- name: Run Obsidian Export | |
run: | | |
rm -rf ./content/knowledge-system | |
mkdir -p ./content/knowledge-system | |
obsidian-export ./knowledge-system ./content/knowledge-system | |
- name: Commit Changes | |
run: | | |
rm -rf ./knowledge-system | |
git config user.name github-actions | |
git config user.email github-actions@github.com | |
git add ./content/knowledge-system/. | |
git commit --allow-empty -m "Synced from knowledge-system: $(date +%Y-%m-%d)" | |
git push origin -f HEAD:main |