CICD: make joplin config more explicit #7
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: Get Wiki contents from Joplin | |
on: | |
push: | |
branches: [ "master" ] | |
schedule: | |
- cron: "0 0 * * *" | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [22.x] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'npm' | |
- name: Login and sync Joplin Wiki notebook | |
env: | |
JOPLIN_PATH: ${{ secrets.JOPLIN_PATH }} | |
JOPLIN_USER: ${{ secrets.JOPLIN_USER }} | |
JOPLIN_PASSWORD: ${{ secrets.JOPLIN_PASSWORD }} | |
run: | | |
npx joplin config sync.target 9 | |
npx joplin config sync.9.path "$JOPLIN_PATH" | |
npx joplin config sync.9.user "$JOPLIN_USER" | |
npx joplin config sync.9.password "$JOPLIN_PASSWORD" | |
npx joplin sync | |
rm -rf src/ | |
npx joplin export --format md --notebook Wiki src/ | |
- name: Build mdbook summary | |
run: ./generate_summary.py | |
- uses: EndBug/add-and-commit@v9 # You can change this to use a specific version. | |
with: | |
add: 'src' | |
default_author: github_actions | |
message: 'Sync wiki contents with upstream' | |
pathspec_error_handling: exitImmediately |