Skip to content

Commit bf4e565

Browse files
authored
Merge pull request #86 from actions/document-usage
Update README.md to include usage
2 parents 37c0d29 + bdbcb4c commit bf4e565

File tree

2 files changed

+62
-8
lines changed

2 files changed

+62
-8
lines changed

.github/workflows/test.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@ on:
44
push:
55
branches:
66
- main
7-
paths-ignore:
8-
- "README.md"
97
pull_request:
10-
paths-ignore:
11-
- "README.md"
128
env:
139
# Use docker.io for Docker Hub if empty
1410
REGISTRY: ghcr.io

README.md

Lines changed: 62 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,73 @@
22

33
A simple GitHub Action for producing Jekyll build artifacts compatible with GitHub Pages.
44

5-
# Scope
5+
## Scope
66

77
This is used along with [`actions/deploy-pages`](https://github.com/actions/deploy-pages) as part of the official support for building Pages with Actions (currently in public beta for public repositories).
88

9-
# Usage
9+
## Usage
1010

11-
See [action.yml](action.yml)
11+
A basic Pages deployment workflow with the `jekyll-build-pages` action looks like this.
1212

13-
# Release instructions
13+
```yaml
14+
name: Build Jekyll site
15+
on:
16+
push:
17+
branches: ["main"]
18+
permissions:
19+
contents: read
20+
pages: write
21+
id-token: write
22+
jobs:
23+
build:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v3
28+
- name: Setup Pages
29+
uses: actions/configure-pages@v3
30+
- name: Build
31+
uses: actions/jekyll-build-pages@v1
32+
- name: Upload artifact
33+
uses: actions/upload-pages-artifact@v1
34+
deploy:
35+
runs-on: ubuntu-latest
36+
needs: build
37+
steps:
38+
- name: Deploy to GitHub Pages
39+
id: deployment
40+
uses: actions/deploy-pages@v2
41+
environment:
42+
name: github-pages
43+
url: ${{ steps.deployment.outputs.page_url }}
44+
```
45+
46+
To write to a different destination directory, match the inputs of both the `jekyll-build-pages` and [`upload-pages-artifact`](https://github.com/actions/upload-pages-artifact) actions.
47+
48+
```yaml
49+
steps:
50+
- name: Build
51+
uses: actions/jekyll-build-pages@v1
52+
with:
53+
destination: "./output"
54+
- name: Upload artifact
55+
uses: actions/upload-pages-artifact@v1
56+
with:
57+
path: "./output"
58+
```
59+
60+
### Action inputs
61+
62+
| Input | Default | Description |
63+
|-------|---------|-------------|
64+
| `source` | `./` | The directory to build from |
65+
| `destination` | `./_site` | The directory to write output into<br>(this should match the `path` input of the [`actions/upload-pages-artifact`](https://github.com/actions/upload-pages-artifact) action) |
66+
| `future` | `false` | If `true`, writes content dated in the future |
67+
| `build_revision` | `$GITHUB_SHA` | The SHA-1 of the Git commit for which the build is running |
68+
| `verbose` | `false` | If `true`, prints verbose output in logs |
69+
| `token` | `$GITHUB_TOKEN` | The GitHub token used to authenticate API requests |
70+
71+
## Release instructions
1472

1573
In order to release a new version of this Action:
1674

0 commit comments

Comments
 (0)