Skip to content
This repository has been archived by the owner on Nov 21, 2023. It is now read-only.

Commit

Permalink
Converting to a simple docker image repo
Browse files Browse the repository at this point in the history
  • Loading branch information
faceleg committed Nov 20, 2023
1 parent bd6669f commit 13f9454
Show file tree
Hide file tree
Showing 12 changed files with 17 additions and 234 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-publish-root-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
with:
context: .
file: ./build-image/Dockerfile
file: Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Expand Down
20 changes: 15 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Built from ./build-image/Dockerfile
FROM ghcr.io/faceleg/jekyll-deploy-gh-pages:master
# This is the main Dockerfile for this repository
FROM ruby:3.1

# Set default locale for the environment
ENV LC_ALL C.UTF-8
Expand All @@ -13,6 +13,16 @@ LABEL "com.github.actions.color"="green"

LABEL "repository"="http://github.com/Li357/jekyll-deploy-gh-pages"

# ADD entrypoint.sh /entrypoint.sh
#
# ENTRYPOINT ["/entrypoint.sh"]
# Install NodeJS
RUN apt-get update && apt-get install -y ca-certificates curl gnupg && apt-get clean
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
ENV NODE_MAJOR=21
RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_${NODE_MAJOR}.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
RUN apt-get update && apt-get install nodejs -y && apt-get clean

# Install image compressor/manager
RUN apt-get install -y libvips imagemagick libvips-tools && apt-get clean

# Install OpenJDK-11
RUN apt-get install -y default-jre && \
apt-get clean;
40 changes: 1 addition & 39 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,39 +1 @@
# A GitHub Action for Custom Jekyll Builds on GitHub Pages

A GitHub Action for building and deploying a Jekyll repo back to its `gh-pages` branch.

**Why not just let GitHub Pages build it? Because this way we can use our own custom Jekyll plugins and build scripts.**

## Secrets
* `GITHUB_TOKEN`: An access key which scoped to the repository - we need this to push the built site files back to the repo. This is generated for you on each workflow run——see usage in [example](#example). (GitHub Provides)

## Environment Variables
* `GITHUB_ACTOR`: Username of repo owner or object initiating the action (GitHub Provides)
* `GITHUB_REPO`: Owner/Repository (GitHub Provides)

## Example

```yml
name: Jekyll Deploy

on: [push]

jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Build & Deploy to GitHub Pages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ secrets.GITHUB_REPOSITORY }}
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }}
uses: faceleg/jekyll-deploy-gh-pages@master
```
Clones the repo, builds the site, and commits it back to the `gh-pages` branch of the repository. That's it. Just add the above example to a `main.yml` file in the `.github/workflows` directory of your repository—see caveats below.

## Caveats

* `destination:` should be set to `./build` in your `_config.yml` file—as God demands.
* A `Gemfile` is required. This must include `jekyll` and any other custom gems.
# A Docker Image for Building GitHub Pages Static Sites with Custom Plugins
9 changes: 0 additions & 9 deletions action.yml

This file was deleted.

31 changes: 0 additions & 31 deletions build-image/Dockerfile

This file was deleted.

19 changes: 0 additions & 19 deletions build/Dockerfile

This file was deleted.

29 changes: 0 additions & 29 deletions build/README.md

This file was deleted.

8 changes: 0 additions & 8 deletions build/entrypoint.sh

This file was deleted.

9 changes: 0 additions & 9 deletions deploy/Dockerfile

This file was deleted.

32 changes: 0 additions & 32 deletions deploy/README.md

This file was deleted.

14 changes: 0 additions & 14 deletions deploy/entrypoint.sh

This file was deleted.

38 changes: 0 additions & 38 deletions entrypoint.sh

This file was deleted.

0 comments on commit 13f9454

Please sign in to comment.