-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Feat: extend Docker Support #1142
base: v4
Are you sure you want to change the base?
Conversation
An exemplary pipeline run and artifact were generated into: |
This image also supports running in GitLab CI to push into GitLab Pages: image:
name: ghcr.io/allmende/quartz:v4
entrypoint: [""]
pages:
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
stage: deploy
environment: live
before_script:
- cd /usr/src/app
- mkdir -p public
script:
- cp $CI_PROJECT_DIR/quartz.*.ts .
- npx quartz build -d $CI_PROJECT_DIR/content
- mv public $CI_PROJECT_DIR
artifacts:
paths:
- public The minimal example for the file system layout of a content repository without including a whole fork of Quartz looks like this: .
├── content
│ └── index.md
├── quartz.config.ts
└── quartz.layout.ts |
there seem to be some issues with the linting, you can see the action logs |
I've pushed a commit to fix the linter issues, which seem to be resolved. While there is no definition of a content repository for quartz, we have updated our patterns. .
├── .quartz
│ ├── quartz
│ │ └── components
│ │ ├── Backlinks.tsx
│ │ └── Footer.tsx
│ ├── quartz.config.ts
│ └── quartz.layout.ts
├── content
│ └── index.md
└── .gitlab-ci.yml The CI needs to be adapted as well: image:
name: ghcr.io/allmende/quartz:v4
entrypoint: [""]
pages:
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
stage: deploy
environment: live
before_script:
- cd /usr/src/app
- mkdir -p public
script:
- cp -R $CI_PROJECT_DIR/.quartz/* .
- npx quartz build -d $CI_PROJECT_DIR/content
- mv public $CI_PROJECT_DIR
artifacts:
paths:
- public By using the dot pattern for the Quartz configuration, we can cleanly separate the concerns of content and configuration and can still apply a custom overlay, e.g. here also for certain components. |
docker build --load -t ghcr.io/jackyzha0/quartz . | ||
``` | ||
|
||
This example expects a `content/` directory with the `quartz.*.ts` configuration files and a (empty) `public/` directory to be present in the preesent working directory. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you illustrate the working directory structure here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good suggestion.
My exemplary way to use this container has also changed a bit, as illustrated in my previous comment. I will update the file.
These commits package Quartz as a container here at the GitHub container registry when a new tag is pushed:
The CI workflow is prepared to also push to Docker Hub. There is also a workflow dispatch trigger to create manual builds. The configuration could be parametrised more in the future.
The Dockerfile has been minimally modified to conform to the OCI standard with regards to the entrypoint and its command, plus has been extended with the missing
git
dependency to be able to use thebuild
command.The documentation has been extended with some examples on how to use the image.
The documentation expects the image to be pushed to
ghcr.io/jackyzha0/quartz
.