Get Started
This section explains the steps for actually using nexterias/actions-vercel to deploy to Vercel.
Prerequisites
- A GitHub account
- A Vercel account
- Vercel CLI
Create a Repository and Vercel Project
First, create a repository on GitHub.
To create a private repository, remove the --public flag and add the --private flag.
Next, create a project on Vercel.
If the command completes successfully, a folder named .vercel should be created in the current directory, and project.json should be created inside it.
The project.json file contains two properties, projectId and orgId. Record each value.
Create a Vercel Access Token
Go to Account Settings and create an access token.
After filling in the fields above and clicking Create, you will receive an access token. Record its value.
Register Secret Information
- Go to the repository page from github,com
- Click the Settings tab
- In the Security section, click Secrets and variables
- Click the Secrets tab
Register the values above from New repository secret as follows.
Configure GitHub Actions
Create a .github/workflows directory in your repository, then create a file named vercel.yml in it with the following contents.
You can now deploy to Vercel with GitHub Actions.
GITHUB_TOKEN Permissions
Additional information about the items specified in jobs.*.permissions:
It also works when contents is set to only read, but the features that imitate Vercel's GitHub integration become unavailable.