{"id":24189398,"url":"https://github.com/devsunb/logseq-publish","last_synced_at":"2025-03-03T03:21:56.173Z","repository":{"id":105189070,"uuid":"584614089","full_name":"devsunb/logseq-publish","owner":"devsunb","description":null,"archived":false,"fork":false,"pushed_at":"2023-01-15T21:47:34.000Z","size":495,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-01-13T14:37:17.277Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devsunb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-03T04:05:19.000Z","updated_at":"2023-01-15T22:05:39.000Z","dependencies_parsed_at":"2023-07-13T22:16:51.381Z","dependency_job_id":null,"html_url":"https://github.com/devsunb/logseq-publish","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devsunb%2Flogseq-publish","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devsunb%2Flogseq-publish/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devsunb%2Flogseq-publish/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devsunb%2Flogseq-publish/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devsunb","download_url":"https://codeload.github.com/devsunb/logseq-publish/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241601163,"owners_count":19988878,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-13T14:29:32.966Z","updated_at":"2025-03-03T03:21:56.168Z","avatar_url":"https://github.com/devsunb.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Logseq Publish Action\n\nPublish your [Logseq](http://github.com/logseq/logseq) graph with a GitHub Action. ✨\n\nThis action is the missing piece for achieving a complete CD workflow for your public Logseq graph.\n\n- It will load your graph and publish it into `www` (this is configurable) folder.\n- Next, you can then deploy `www` folder with [JamesIves/github-pages-deploy-action](https://github.com/JamesIves/github-pages-deploy-action).\n\n## Example Logseq Graphs Published with this Action\n\n- https://docs.logseq.com/\n- https://note.xuanwo.io/\n- https://pengx17.github.io/knowledge-garden/\n- https://io-oi.me/wiki/\n- https://docs.unickcheng.cc/\n\n## Usage\n\nA video walk through\nhttps://www.youtube.com/watch?v=UYqJcFEYUsY\n\nFirstly, add this step to your Github workflow. You can refer to My Example Graph's [workflows/main.yml](https://github.com/pengx17/knowledge-garden/blob/main/.github/workflows/main.yml) as an example.\n\n```yml\nsteps:\n  - uses: actions/checkout@v2\n  - name: Logseq Publish 🚩\n    uses: pengx17/logseq-publish@v0.1\n  - name: add a nojekyll file # to make sure asset paths are correctly identified\n    run: touch $GITHUB_WORKSPACE/www/.nojekyll\n  - name: Deploy 🚀\n    uses: JamesIves/github-pages-deploy-action@4.1.9\n    with:\n      branch: gh-pages # The branch the action should deploy to.\n      folder: www # The folder the action should deploy.\n      clean: true\n```\n\nWhenever you push changes to your Github repo, your graph will be published to the `gh-pages` branch. A few minutes later, your GitHub Pages will get updated.\n\n## All options\n\n- `src`: Publish graph src directory. Defaults to `` (empty string, root repo directory).\n- `dest`: Publish destination directory. Defaults to `www`.\n- `trace`: Whether or not to generate and publish trace file for debugging. This trace file will be uploaded as an artifact to the run. Defaults to `true`.\n- `theme`: Selected theme. Defaults to `light`.\n\n## How it works\n\nHere is a [document](https://pengx17.github.io/knowledge-garden/#/page/logseq%20publish%20github%20action) about the story behind this action.\n\nTLDR., this action will start Logseq desktop App in a Docker container, automate it by Playwright and finally load \u0026 publish the graph.\n\nSince most of the work is done in a [prepared Docker container](https://github.com/pengx17/logseq-publish/pkgs/container/logseq-publish), you can refer to [action.yml](./action.yml) and adapt it in other places without the need for GitHub actions.\n\nHint: you can checkout the trace file in the action artifacts and view it in the [Playwright trace viewer](https://trace.playwright.dev/) to see what's going on in the action.\n\nhttps://user-images.githubusercontent.com/584378/163351229-ba281c08-c29d-4cf5-8223-337bf80b8726.mp4\n\n## Alternate usage examples\n\n- One-liner Powershell call with only Docker installed as prerequisite.\n  Below assumes that your folder workfolder has \"KnowledgeGraph\" for the graph, and \"HTMLOutput\" for the output. Container will be created and discarded on the fly.\n\n```\nPS C:\\\u003e docker run -d -i  `\n\t     --name LogSeqPublishContainer  `\n\t     --rm `\n\t     -v D:\\WorfklowScripts\\PublishLogseqExport\\graph:/home/logseq/graph  `\n\t     -w /home/logseq  `\n\t     ghcr.io/pengx17/logseq-base:master  `\n\t     bash -c \"xvfb-run node /home/logseq/graph/publish.mjs -p /home/logseq/graph/KnowledgeGraph -t /home/logseq/graph/build_trace.txt -o /home/logseq/graph/HTMLOutput \u003e /home/logseq/graph/build.log\"\n```\n\n## Local development\n\n- clone https://github.com/logseq/logseq.git \u0026 https://github.com/pengx17/logseq-publish.git\n- build logseq app\n\t- cd into logseq src root\n  - change  `\"name\": \"Logseq\"` in `resources/package.json` to `\"name\": \"something-else\"`\n\t- run `yarn` \u0026\u0026 `yarn release`\n  - cd into `static` and run `yarn` \u0026\u0026 `yarn rebuild:better-sqlite3`\n- copy logseq static into `logseq-publish/public/static`\n\t- in logseq-publish root, run\n\t\t- `mkdir public`\n\t\t- `cp -r ../logseq/static ./public/static` (assuming logseq and logseq-publish is at the same folder)\n- install logseq-publish deps\n\t- makes sure you have `pnpm` \u0026 Node \u003e 16 installed\n\t- run `pnpm i`\n- now you should be able to use `node publish.mjs` to run the script\n\nHints:\n- use [Playwright Debugging tools | Playwright](https://playwright.dev/docs/debug) to debug the script. `PWDEBUG=1 node publish.mjs`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevsunb%2Flogseq-publish","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevsunb%2Flogseq-publish","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevsunb%2Flogseq-publish/lists"}