angular-docs-cn/aio/aio-builds-setup/docs/vm-setup--set-up-secrets.md
George Kalpakas d8d276c245 docs(docs-infra): update preview server docs to account for recent changes (#25671)
Mostly (but not exclusively) a follow-up to #23576.

PR Close #25671
2018-09-26 15:26:19 -07:00

40 lines
1005 B
Markdown

# VM Setup - Set up secrets
## Overview
Necessary secrets:
1. `GITHUB_TOKEN`
- Used for:
- Retrieving open PRs without rate-limiting.
- Retrieving PR info, such as author, labels, changed files.
- Retrieving members of the trusted GitHub teams.
- Posting comments with preview links on PRs.
2. `CIRCLE_CI_TOKEN`
- Used for:
- Retrieving build information.
- Downloading build artifacts.
## Create secrets
1. `GITHUB_TOKEN`
- Visit https://github.com/settings/tokens.
- Generate new token with the `public_repo` scope.
2. `CIRCLE_CI_TOKEN`
- Visit https://circleci.com/gh/angular/angular/edit#api.
- Create an API token with `Build Artifacts` scope.
## Save secrets on the VM
- `sudo mkdir /aio-secrets`
- `sudo touch /aio-secrets/GITHUB_TOKEN`
- Insert `<github-token>` into `/aio-secrets/GITHUB_TOKEN`.
- `sudo touch /aio-secrets/CIRCLE_CI_TOKEN`
- Insert `<access-token>` into `/aio-secrets/CIRCLE_CI_TOKEN`.
- `sudo chmod 400 /aio-secrets/*`