Skip to content

Dendron workspace sync #183

Dendron workspace sync

Dendron workspace sync #183

name: Dendron
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v2
with:
fetch-depth: 0
# Retain Node modules across builds
- name: Restore Node modules cache
uses: actions/cache@v2
id: node-modules-cache
with:
path: |
node_modules
.next/node_modules
key: node-modules-${{ hashFiles('yarn.lock')}}
- name: Install npm dependencies
run: yarn
# if you need to fetch remote vaults, uncomment the below
# - name: Initialze workspace
# run: dendron workspace init
- name: Initialize .next
run: yarn dendron publish init
- name: Install dependencies
run: cd .next && yarn && cd ..
- name: Export notes
run: yarn dendron publish build
- name: Prep notes for publish
run: cd .next && yarn export && cd ..
- name: Update files
run: |
cd .next && [[ -d ../docs ]] && rm -r ../docs && mv out ../docs && touch ../docs/.nojekyll && cd ..
- name: Deploy site
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: pages
publish_dir: docs/
force_orphan: true
# if you have a custom domain, you can uncomment the below and add it here
# cname: "{{REPLACE_WITH_YOUR_CNAME}}"