Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitLab CI example #18

Closed
almereyda opened this issue Dec 7, 2023 · 5 comments
Closed

GitLab CI example #18

almereyda opened this issue Dec 7, 2023 · 5 comments
Labels
documentation Improvements or additions to documentation

Comments

@almereyda
Copy link

What Happened?

logseq-publish had GitLab examples, and now redirects here. Unfortunately no GitLab-related discussion has yet arisen in the issues.

Reproduce the Bug

  1. Check logseq-publish GitLab examples
  2. Find logseq-publish deprecated, linking here
  3. Find no GitLab examples of logseq/publish-spa

Expected Behavior

It could be nice to showcase how to build a LogSeq container in which this CLI runs, and use its image for building LogSeq pages from graphs stored in git repositories on GitLab.

Desktop or Mobile Platform Information

N/A

@almereyda
Copy link
Author

I'll likely try this in the next few months.

@logseq-cldwalker logseq-cldwalker added the documentation Improvements or additions to documentation label Dec 14, 2023
@logseq-cldwalker
Copy link
Contributor

Hi. I'm happy to take an example link like https://github.com/pengx17/logseq-publish for anyone who wants to work on this. https://github.com/logseq/publish-spa/blob/main/action.yml should be all that's needed to understand replicating this action on another service

@logseq-cldwalker
Copy link
Contributor

There is now https://github.com/L-Trump/logseq-publish-docker for anyone who wants to contribute this documentation

@almereyda
Copy link
Author

Thank you for the hint!

This .gitlab-ci.yml manifest works:

image:
  name: ghcr.io/l-trump/logseq-publish-spa:alpine
  entrypoint: ["/bin/sh", "-c"]

stages:
  - deploy

pages:
  rules:
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH

  stage: deploy
  environment: live

  variables:
    THEME: light
    ACCENT_COLOR: blue

  script:
    - mkdir -p public
    - node /opt/logseq-publish-spa/publish_spa.mjs $CI_PROJECT_DIR/public --static-directory /opt/logseq-static --directory $CI_PROJECT_DIR --theme-mode $THEME --accent-color $ACCENT_COLOR

  artifacts:
    paths:
      - public

This assumes pages: public, which is the default and can be omitted.

The top-level stages key could optionally also be omitted, but I like expressiveness.

@logseq-cldwalker
Copy link
Contributor

Nice! I've linked to this example in the readme

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants