Implement Jekyll CI workflow with docker #2
|
@ -5,6 +5,8 @@ on: [push]
|
||||||
env:
|
env:
|
||||||
_UID: 1000
|
_UID: 1000
|
||||||
_GID: 1000
|
_GID: 1000
|
||||||
|
_USER: appuser
|
||||||
|
_GROUP: appgroup
|
||||||
jobs:
|
jobs:
|
||||||
jekyll:
|
jekyll:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
|
@ -33,18 +35,12 @@ jobs:
|
||||||
- name: Build Jekyll image
|
- name: Build Jekyll image
|
||||||
id: build_image
|
id: build_image
|
||||||
run: |
|
run: |
|
||||||
# The environment variables _UID and _GID will impact this image
|
# The environment variables _UID, _GID, _USER and _GROUP will impact this image
|
||||||
docker-compose build jekyll
|
docker-compose build jekyll
|
||||||
- name: Verify Jekyll container
|
|
||||||
id: verify_image
|
|
||||||
run: |
|
|
||||||
docker-compose run --rm -v "/var/lib/docker/volumes/${JOB_CONTAINER_NAME}/_data:/home/ubuntu/workspace" \
|
|
||||||
--entrypoint bash \
|
|
||||||
jekyll -c "whoami; pwd; ls -lA ."
|
|
||||||
- name: Build Jekyll site
|
- name: Build Jekyll site
|
||||||
id: build_site
|
id: build_site
|
||||||
run: |
|
run: |
|
||||||
docker-compose run --rm -v "/var/lib/docker/volumes/${JOB_CONTAINER_NAME}/_data:/home/ubuntu/workspace" \
|
docker-compose run --rm -v "${JOB_CONTAINER_NAME}:/home/${_USER}/workspace" \
|
||||||
jekyll build --verbose
|
jekyll build --verbose
|
||||||
- name: Verify site
|
- name: Verify site
|
||||||
id: verify_site
|
id: verify_site
|
||||||
|
|
|
@ -10,9 +10,9 @@ RUN INSTALL_PKGS="gcc g++ libyaml-dev make nodejs" && \
|
||||||
|
|
||||||
# Parameters for default user:group
|
# Parameters for default user:group
|
||||||
ARG uid=1000
|
ARG uid=1000
|
||||||
ARG user=ubuntu
|
ARG user=appuser
|
||||||
ARG gid=1000
|
ARG gid=1000
|
||||||
ARG group=ubuntu
|
ARG group=appgroup
|
||||||
|
|
||||||
# Ensure desired user and group for build and runtime (convenient)
|
# Ensure desired user and group for build and runtime (convenient)
|
||||||
RUN userdel --force --remove $(getent passwd ${uid} | cut -d: -f1) || true; \
|
RUN userdel --force --remove $(getent passwd ${uid} | cut -d: -f1) || true; \
|
||||||
|
|
Loading…
Reference in New Issue