Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/extrawitz/11ty-dockerless-build
Build 11ty (Eleventy) dockerless to be able to use i.e. eleventy-img pluging with gh-runners
https://github.com/extrawitz/11ty-dockerless-build
eleventy eleventy-plugin eleventy-website foss gh-action gh-actions-repo
Last synced: 27 days ago
JSON representation
Build 11ty (Eleventy) dockerless to be able to use i.e. eleventy-img pluging with gh-runners
- Host: GitHub
- URL: https://github.com/extrawitz/11ty-dockerless-build
- Owner: extrawitz
- License: mit
- Created: 2023-01-10T20:17:41.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-08-18T10:20:14.000Z (about 1 year ago)
- Last Synced: 2024-04-25T10:22:05.717Z (7 months ago)
- Topics: eleventy, eleventy-plugin, eleventy-website, foss, gh-action, gh-actions-repo
- Homepage:
- Size: 34.2 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Build Eleventy (11ty)
![](IdthKOzqFA-350.avif)
This action fetches all dependencies via **npm install** which are specified in your **.eleventy.js** and builds then the website.
No docker is used. No root-permissions needed on your self-hosted runner
### Features
- this action runs flawless without root-permissions as docker is not used.
- you can use most common plugins, i.e. **@11ty/eleventy-img** which ist not possible with docker-gh-actions.
- You can pass custom args to the eleventy-command### Pre-Requisites
- your site has to run smoothly on your local machine.
- You need a proper ".eleventy.js" file https://www.11ty.dev/docs/config/
- You will need proper passthrough config i.e. for your assets-folder https://www.11ty.dev/docs/copy/
- You need to have a **valid local package.json** in your repo, so that **npm** / **npx** works clean.### Example-Workflow
```
name: 11ty build
on: [push]
jobs:
build_deploy:
runs-on: self-hosted
steps:
- name: Checkout last commit of repository
uses: actions/checkout@v3
- name: Install 11ty and build website
uses: extrawitz/11ty-dockerless-build@v1
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
publish_dir: public
publish_branch: website
github_token: ${{ secrets.PSA }}
```#### Use your custom args when building website with "eleventy"
To use your custom arguments, specify them in your workflow like in below example:
```
name: 11ty build
on: [push]
jobs:
build_deploy:
runs-on: self-hosted
steps:
- name: Checkout last commit of repository
uses: actions/checkout@v3
- name: Install 11ty and build website
uses: extrawitz/11ty-dockerless-build@v1
with:
args: --formats=md,html,ejs
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
publish_dir: public
publish_branch: website
github_token: ${{ secrets.PSA }}
```See more details about this in eleventy-doc
https://www.11ty.dev/docs/usage/### Pro-Tipp to keep your main-branch clean when working with Eleventy
You can exclude your public-folder from commits with adding a entry for the public folder into your .git/info/exclude file
#### Example
```
# git ls-files --others --exclude-from=.git/info/exclude
# Lines that start with '#' are comments.
# For a project mostly in C, the following would be a good set of
# exclude patterns (uncomment them if you want to use them):
# *.[oa]
# *~public/*
```More Infos on that here https://git-scm.com/docs/gitignore#_description
PS @ Microsoft - branch specific .gitignores would be alltough nice :-)