Skip to content

Instantly share code, notes, and snippets.

@kevinslin
Last active October 19, 2021 22:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kevinslin/56810d500f28c3887b66ce737a37ef94 to your computer and use it in GitHub Desktop.
Save kevinslin/56810d500f28c3887b66ce737a37ef94 to your computer and use it in GitHub Desktop.
publish.yml
name: Dendron
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v2
with:
fetch-depth: 0
- 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
- name: Initialze workspace
run: yarn 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment