Skip to content

Commit

Permalink
Add a tip for deploying with Github Actions
Browse files Browse the repository at this point in the history
The tip should lay out how to correctly configure a step to deploy an application via Github Actions. See issue #345 for more details
  • Loading branch information
mickelsonmichael committed Aug 17, 2020
1 parent e363b14 commit f67964d
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -387,3 +387,19 @@ Note that this plugin requires Git 1.9 or higher (because it uses the `--exit-co
The `gh-pages` module writes temporary files to a `node_modules/.cache/gh-pages` directory. The location of this directory can be customized by setting the `CACHE_DIR` environemnt variable.

If `gh-pages` fails, you may find that you need to manually clean up the cache directory. To remove the cache directory, run `node_modules/gh-pages/bin/gh-pages-clean` or remove `node_modules/.cache/gh-pages`.

### Deploying with Github Actions

In order to deploy with Github Actions, you will need to define a user and set the git repository for the process. See the example step below

```
# REPLACE "tschaub/gh-pages" IN THE GIT URL BELOW WITH YOUR REPOSITORY'S INFORMATION
- name: Deploy with gh-pages
run: |
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/tschaub/gh-pages.git
npx gh-pages -d build -u "github-actions-bot <support+actions@github.com>"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```

The `secrets.GITHUB_TOKEN` is provided automatically as part of the Github Action and does not require any further configuration, but simply needs to be passed in as an environmental variable to the step.

0 comments on commit f67964d

Please sign in to comment.