docs: update for v3

This commit is contained in:
peaceiris 2020-02-05 17:02:53 +09:00
parent 00bca7b88c
commit 428902c6cd
1 changed files with 14 additions and 17 deletions

View File

@ -269,40 +269,37 @@ For example:
### ⭐️ Deploy to external repository ### ⭐️ Deploy to external repository
By default, your files are published to the repository which is running this action. By default, your files are published to the repository which is running this action.
If you want to publish to another repository on GitHub, set the environment variable `EXTERNAL_REPOSITORY` to `<username>/<external-repository>`. If you want to publish to another repository on GitHub, set the environment variable `external_repository` to `<username>/<external-repository>`.
This option is available from `v2.5.0`.
For example: For example:
```yaml ```yaml
- name: Deploy - name: Deploy
uses: peaceiris/actions-gh-pages@v2 uses: peaceiris/actions-gh-pages@v3
env: with:
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }} deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
EXTERNAL_REPOSITORY: username/external-repository external_repository: username/external-repository
PUBLISH_BRANCH: gh-pages publish_branch: gh-pages
PUBLISH_DIR: ./public publish_dir: ./public
``` ```
You can use `ACTIONS_DEPLOY_KEY` or `PERSONAL_TOKEN`. You can use `deploy_key` or `personal_token`.
When you use `ACTIONS_DEPLOY_KEY`, set your private key to the repository which includes this action and set your public key to your external repository. When you use `deploy_key`, set your private key to the repository which includes this action and set your public key to your external repository.
Be careful, `GITHUB_TOKEN` has no permission to access to external repositories. Be careful, `GITHUB_TOKEN` has no permission to access to external repositories.
### ⭐️ Force orphan ### ⭐️ Force orphan
From `v2.6.0`, we can set the `forceOrphan: true` option. We can set the `force_orphan: true` option.
This allows you to make your publish branch with only the latest commit. This allows you to make your publish branch with only the latest commit.
```yaml ```yaml
- name: Deploy - name: Deploy
uses: peaceiris/actions-gh-pages@v2 uses: peaceiris/actions-gh-pages@v3
env:
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: ./public
with: with:
forceOrphan: true deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
publish_dir: ./public
force_orphan: true
``` ```
### ⭐️ Set Git username and email ### ⭐️ Set Git username and email