https://github.com/tswicegood/github-actions-gh-pages
https://github.com/tswicegood/github-actions-gh-pages
actions
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/tswicegood/github-actions-gh-pages
- Owner: tswicegood
- Created: 2019-02-22T23:05:12.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-02-23T02:29:21.000Z (over 7 years ago)
- Last Synced: 2025-07-31T06:44:00.969Z (11 months ago)
- Topics: actions
- Language: Dockerfile
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GitHub Action for `gh-pages`
This repo contains [GitHub Action][1] for generating gh-pages. It consists of two actions:
- `create`
- `push`
## Usage
These actions create and publish your `gh-pages` branch inside a `./public` directory. See [Configuration](#Configuration) to learn how to change that directory.
You can use these actions in your workflow like this:
```workflow
action "Prep gh-pages" {
uses = "tswicegood/github-actions-gh-pages/create@master"
secrets = ["GITHUB_TOKEN"]
}
// do something here to build your public directory
action "Push gh-pages" {
uses = "tswicegood/github-actions-gh-pages/push@master"
needs = ["whatever-built-your-site"]
}
```
> Note: You have to enable the `GITHUB_TOKEN` secret on the action that uses `create`. Without that, you can't publish your changes.
## Configuration
Each action exposes a couple of environment variables. For most use, you can probably leave it alone. To change them, adjust the [env][gh-actions-env], like this:
```markdown
action "Prep gh-pages" {
uses = "tswicegood/github-actions-gh-pages/create@master"
secrets = ["GITHUB_TOKEN"]
env = {
DESTINATION = "./my-public"
}
}
```
| | Description | Default | Actions |
| - | ----------- | ------- | - |
| `DESTINATION` | Controls where the gh-pages repository is created | `./public` | `create`, `push` |
| `TARGET_BRANCH` | Controls which branch we want to publish. Note: Changing this will mess up gh-pages deployments | `gh-pages` | `create`, `push` |
| `GH_EMAIL` | Email address for commit | friendly-bot@example.com | `create` |
| `GH_NAME` | Name of the committer | Friendly GitHub Action Deploy Bot | `create` |
[1]: https://github.com/features/actions
[gh-actions-env]: https://developer.github.com/actions/creating-github-actions/accessing-the-runtime-environment/#environment-variables