|
2 | 2 |
|
3 | 3 | A simple GitHub Action for producing Jekyll build artifacts compatible with GitHub Pages.
|
4 | 4 |
|
5 |
| -# Scope |
| 5 | +## Scope |
6 | 6 |
|
7 | 7 | 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).
|
8 | 8 |
|
9 |
| -# Usage |
| 9 | +## Usage |
10 | 10 |
|
11 |
| -See [action.yml](action.yml) |
| 11 | +A basic Pages deployment workflow with the `jekyll-build-pages` action looks like this. |
12 | 12 |
|
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 |
14 | 72 |
|
15 | 73 | In order to release a new version of this Action:
|
16 | 74 |
|
|
0 commit comments