8 Commits
v1.0.7 ... main

Author SHA1 Message Date
200330548d Remove root requirement 2023-07-12 00:15:22 +00:00
588ec39451 Add trace to jekyll 2023-07-12 00:13:26 +00:00
6f9435328c Add write permissions to working directory 2023-07-12 00:10:18 +00:00
2bbd2b9194 Change entrypoint for different working folder 2023-07-12 00:08:11 +00:00
184c687f92 Update action.yml 2023-07-12 00:06:11 +00:00
a7f015f130 Revert to vivi action 2023-07-12 00:05:46 +00:00
d80d8c1b77 Attempt to add lines that might be causing silent crash 2023-07-12 00:04:31 +00:00
9231edac85 Try a different docker image 2023-07-11 23:57:07 +00:00
4 changed files with 52 additions and 59 deletions

View File

@@ -1,7 +1,9 @@
# This image is cached on the Github Actions VM, so it drastically reduces build time FROM jekyll/minimal:latest
FROM jekyll/builder:latest LABEL version="1.2.0"
USER root LABEL description="Minimal Jekyll image with basic build tools."
LABEL maintainer="Vivien Richter <vivien-richter@outlook.de>"
# Entry point
COPY entrypoint.sh /entrypoint.sh COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"] ENTRYPOINT ["/entrypoint.sh"]

View File

@@ -1,46 +1,44 @@
# jekyll-build-action # Jekyll action
Plain in-place Jekyll build action to be used in pipelines with a variety of possible deploy targets. [![License](https://img.shields.io/badge/%E2%9A%96%EF%B8%8F-CC%20BY%204.0-brightgreen)](https://creativecommons.org/licenses/by/4.0)
# Usage This action provides just Jekyll and some basic build tools ([Alpine's `build-base`](https://pkgs.alpinelinux.org/package/v3.3/main/x86/build-base)).
This Action literally only invokes a Jekyll build, so your pipeline needs to ensure the Jekyll source is first gathered, and once this action completes you must copy the contents of the destination folder to your intended hosting location. It's based on the [jekyll/minimal:latest](https://github.com/envygeeks/jekyll-docker) [Docker](https://docker.com) image and the [jerryjvl/jekyll-build-action](https://github.com/jerryjvl/jekyll-build-action).
A typical example would be a GitHub repository with Jekyll source, and publishing the output to an S3 bucket configured for static site hosting. ## Usage
The pipeline to realize this would look something like the following:
```yaml ```yaml
jobs: jobs:
jekyll: jekyll:
name: Build and deploy Jekyll site name: Build and store Jekyll site
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout 📥
uses: actions/checkout@v2 uses: actions/checkout@v2.3.4
- name: Build
uses: jerryjvl/jekyll-build-action@v1
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with: with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} lfs: true
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} fetch-depth: 1
aws-region: us-east-1
- name: Sync output to S3 - name: Build ⚙️
run: | uses: vivi90/jekyll-minimal-action@v1.1.0
aws s3 sync ./_site/ s3://my-s3-bucket --delete with:
command: jekyll build
- name: Store 📦
uses: actions/upload-artifact@v2.2.4
if: success()
with:
name: site
path: _site
``` ```
Just use the `command` option as you like:
- `jekyll build --trace`
- `jekyll serve`
- and so on..
# References ## Contribution
For more technical details on these steps and associated setup, see: Please feel free to create issues and/or pull requests.
- [actions/checkout](https://github.com/actions/checkout)
- [aws-actions/configure-aws-credentials](https://github.com/aws-actions/configure-aws-credentials)
- [Creating encrypted secrets in GitHub](https://help.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets)
# A Note on Security ## License
Please be mindful of the third-party actions you trust with your secrets, credentials and content. Without investigation you should assume a third-party action might exfiltrate your content to some secondary location, or modify contents before they are published. This project is free software under the terms of the CC BY 4.0 license.
For more details please see the LICENSE file or: [Creative Commons](http://creativecommons.org/licenses/by/4.0)
Futhermore, if you rely on versioning that the publisher of an action can control, the action you think you are running could be changed later without your knowledge. *The licenses of the installed components may differ.*
... Trust but verify!

View File

@@ -1,8 +1,11 @@
name: 'Build Jekyll' name: 'Jekyll Minimal Action'
description: 'Local pipeline build of Jekyll content; follow-on actions must publish it somewhere' author: 'Vivien Richter <vivien-richter@outlook.de>'
description: 'Pure minimal Jekyll pipeline with basic build tools for universal usage.'
runs: runs:
using: 'docker' using: 'docker'
image: 'Dockerfile' image: 'Dockerfile'
args:
- jekyll build --trace
branding: branding:
icon: 'book-open' icon: 'book-open'
color: 'white' color: 'red'

View File

@@ -1,28 +1,18 @@
#!/bin/sh #!/bin/sh
set -x # verbose mode # Set verbose mode
set -e # stop executing after error set -x
echo "Starting Jekyll build" # Stop executing after error
set -e
#################################################### # Use working directory
# Set workspace permissions chmod -R a+w /root/.cache/act/almouse/personalwebsite
#################################################### cd /root/.cache/act/almouse/personalwebsite
pwd pwd
ls -R ls -R
chmod -R a+w ./ # Run command
$*
####################################################
# Build the Jekyll site
####################################################
jekyll build --trace
####################################################
# Build completed
####################################################
echo "Completed Jekll build"