Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hxlnt/action-build-eleventy

Simple javascript action to build a static site with 11ty
https://github.com/hxlnt/action-build-eleventy

Last synced: 27 days ago
JSON representation

Simple javascript action to build a static site with 11ty

Awesome Lists containing this project

README

        

# Build a static site using 11ty

This actions builds a static site using 11ty (eleventy: https://www.11ty.dev/) from the contents of a repository. It assumes that the repository root is the site source, but this can be configured in the workflow. It is intended to be coupled with other actions in the workflow that push the built site to a cdn or webserver. An example workflow shows how to push the built site to google storage.

The default build directory is the ```$GITHUB_WORKSPACE``` instantiated when using ```actions/checkout```.

```yaml
name: "build-site"
on:
push:
branches:
- master

jobs:
build: # run 11ty
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: mcfitzgerald/action-build-eleventy@master
with:
path: $GITHUB_WORKSPACE
- uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
with:
service_account_key: ${{ secrets.GCE_SA_KEY }}
- run: |
gcloud config set project ${{ secrets.GCE_PROJECT }}
gsutil rsync -r $GITHUB_WORKSPACE/_site ${{ secrets.GS_BUCKET }}

```

While I wrote the action, the project template is a complete rip from the template made available at: https://github.com/actions/typescript-action.git.

The build-test workflow is accurate and tests whether or not 11ty tries to build this action's repo. The test in `__tests__` is a dummy.