Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/davids/jekyll-deploy
Builds and deploys a jekyll page to GitHub pages
https://github.com/davids/jekyll-deploy
Last synced: about 2 months ago
JSON representation
Builds and deploys a jekyll page to GitHub pages
- Host: GitHub
- URL: https://github.com/davids/jekyll-deploy
- Owner: DavidS
- Created: 2020-02-04T13:38:42.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2023-01-23T23:01:33.000Z (almost 2 years ago)
- Last Synced: 2024-10-16T08:35:23.671Z (2 months ago)
- Language: Ruby
- Size: 138 KB
- Stars: 10
- Watchers: 3
- Forks: 6
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# jekyll-deploy
Builds and deploys a jekyll page to GitHub pages.
Features:
* build and test modes
* record the site's source commit using a merge commit
* build from any subdirectory in your repository
* specify a target branch## Usage
To deploy every update to the `main` branch and regenerate the site once a day:
```yaml
name: Jekyll Deployon:
push:
branches:
# deploy on updates on main
- main
schedule:
# redeploy every morning to update unpublished pages
- cron: "0 2 * * *"jobs:
deploy:
runs-on: ubuntu-lateststeps:
- uses: actions/checkout@v2- name: Cache gems
uses: actions/cache@v1
with:
path: vendor/gems
key: ${{ runner.os }}-build-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-build-
${{ runner.os }}-- name: Build & Deploy to GitHub Pages
uses: DavidS/jekyll-deploy@main
env:
JEKYLL_ENV: production
GH_PAGES_TOKEN: ${{ secrets.GH_PAGES_TOKEN }}
```To check PRs, set `build-only: true`:
```yaml
name: Jekyll Teston: [ pull_request ]
jobs:
test:
runs-on: ubuntu-lateststeps:
- uses: actions/checkout@v2- name: Cache gems
uses: actions/cache@v1
with:
path: vendor/gems
key: ${{ runner.os }}-build-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-build-
${{ runner.os }}-- name: Test
uses: DavidS/jekyll-deploy@
with:
build-only: true
env:
JEKYLL_ENV: production
GH_PAGES_TOKEN: ${{ secrets.GH_PAGES_TOKEN }}
```The `GH_PAGES_TOKEN` needs the `public_repo` scope to be able to trigger deployments on a public repo or the full `repo` scope to deploy a private repository. Please note that this is circumventing GitHub's protection for infinitely recursive Actions invocations, so proceed with caution!
## Specifying a source directory
If your site's source is not at the root of the repository, you can use the `source-dir` input to tell this action where the source can be found. For example, if your site is in a `docs/jekyll` subdirectory:
```yaml
- name: Build & Deploy to custom branch
uses: DavidS/jekyll-deploy@
with:
source-dir: docs/jekyll
env:
JEKYLL_ENV: production
GH_PAGES_TOKEN: ${{ secrets.GH_PAGES_TOKEN }}
```## Specifying a target branch
By default, this action deploys the compiled output to `gh-pages`, GitHub's default. If you want to use a different branch, you can use the `target-branch` input to do so. For example, to deploy to `docs`:
```yaml
- name: Build & Deploy to custom branch
uses: DavidS/jekyll-deploy@main
with:
target-branch: docs
env:
JEKYLL_ENV: production
GH_PAGES_TOKEN: ${{ secrets.GH_PAGES_TOKEN }}
```