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

add support for drafts #21

Merged
merged 3 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
name: Docker Build

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

on:
schedule:
# run every Thursday at 01:31
- cron: '31 01 * * 4'
# run on every push to any branch
push:

env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
Expand Down Expand Up @@ -70,4 +65,5 @@ jobs:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
build-args: ${{ contains(github.ref, 'blogpost') && 'BUILD_SCRIPT=build-drafts' || 'BUILD_SCRIPT=build' }}
labels: ${{ steps.meta.outputs.labels }}
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM jekyll/jekyll:builder as builder

ENV WORK_DIR=/var/jekyllbuilder
ARG BUILD_SCRIPT=build

# since WORKDIR will not honour the USER directive
# we need to create the directory and set permissions in advance
Expand All @@ -15,7 +16,7 @@ COPY --chown=jekyll . .
# build local
RUN npm i && \
bundle config set --local path 'vendor/bundle' && \
npm run build
npm run ${BUILD_SCRIPT}

#################
# nginx
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"main": "index.html",
"scripts": {
"build": "webpack && bundle install && bundle exec jekyll build",
"serve": "bundle exec jekyll serve --livereload",
"build-drafts": "webpack && bundle install && bundle exec jekyll build --drafts",
"serve": "bundle exec jekyll serve --livereload --drafts",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
Expand Down
Loading