pengx17 / logseq-publish

Archived. Please check https://github.com/logseq/publish-spa instead

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Make logseq-publish-for-gitlab!

gwpl opened this issue · comments

Feature request: could you make logseq-publish-for-gitlab?

One may like to use https://docs.gitlab.com/ee/user/project/pages/ gitlab pages,
therefore gitlab runner https://docs.gitlab.com/runner/
for fluent CI/CD experience https://docs.gitlab.com/ee/ci/

Gitlab support should live in another project (maybe in gitlab directly so easier for test and adopt). Since logseq-publish is licensed under MIT, It's OK for you to fork one to gitlab~

Hi,

this is what worked for me on gitlab:

First you have to enable pages. (https://docs.gitlab.com/ee/user/project/pages/getting_started/pages_ui.html)

Also I used a scheduled pipeline. (https://docs.gitlab.com/ee/ci/pipelines/schedules.html)

This is my .gitlab-ci-yml:

pages:
  image: ghcr.io/pengx17/logseq-base:master
  stage: deploy
  script:
    - mkdir public
    - mv publish.mjs /home/logseq/publish.mjs
    - cd /home/logseq
    - "xvfb-run node /home/logseq/publish.mjs -p $CI_PROJECT_DIR -t $CI_PROJECT_DIR/public/build_trace.txt -o $CI_PROJECT_DIR/public"
  artifacts:
    paths:
      - public
  only:
    - schedules

My git repository has the following structure:

assets/
journals/
logseq/
pages/
.gitlab-ci-yml
publish.mjs
commented

@MarkusPic Nice work! Can you make this a gist or docs? I'm willing to refer it in the README.

BTW, is publish.mjs copied from this repo?

Oh, I got it. It's copied from the image.

No, I actually copied it from this repository, because I couldn't find it in the docker image.

Here is a gist:
https://gist.github.com/MarkusPic/a757e52b2be8013161165483ad9bf4ed