Reactjs 如何在Vercel中通过Github操作呈现环境?
我使用Github操作Reactjs 如何在Vercel中通过Github操作呈现环境?,reactjs,git,create-react-app,github-actions,vercel,Reactjs,Git,Create React App,Github Actions,Vercel,我使用Github操作envs,同时使用Vercel执行Deploy 我的行动流程是如何运作的。。。如果用户为主分支或分支开发运行git push命令,将发生以下步骤: 使用Lint和Jest测试提交 通过上述步骤,将部署Vercel 我在项目中的工作: # prettier-ignore name: CONTINUOUS INTEGRATION on: push: branches: [ master, develop ] pull_request: branches
envs
,同时使用Vercel
执行Deploy
我的行动流程是如何运作的。。。如果用户为主分支
或分支开发
运行git push
命令,将发生以下步骤:
Lint
和Jest
测试提交Vercel
# prettier-ignore
name: CONTINUOUS INTEGRATION
on:
push:
branches: [ master, develop ]
pull_request:
branches: [ master, develop ]
jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
architecture: [x64]
steps:
- name: Check out Git repository
uses: actions/checkout@v2
- name: Use Nodejs ${{ matrix.node-version }} - ${{ matrix.architecture }}
uses: actions/setup-node@v2
- name: Yarn [Install]
uses: borales/actions-yarn@v2.0.0
with:
cmd: install
- name: Yarn [Lint]
uses: borales/actions-yarn@v2.0.0
with:
cmd: lint-check
- name: Yarn [Test]
uses: borales/actions-yarn@v2.0.0
with:
cmd: test
deploy:
if: ${{ github.ref == 'refs/heads/master' }}
needs: tests
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
architecture: [x64]
steps:
- name: Check out Git repository
uses: actions/checkout@v2
- name: Vercel Deploy
uses: amondnet/vercel-action@v20
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
vercel-args: '--prod'
vercel-org-id: ${{ secrets.VERCEL_ORG_ID}}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID}}
env:
REACT_APP_AUTHOR: ${{ secrets.REACT_APP_AUTHOR }}
REACT_APP_DESCRIPTION: ${{ secrets.REACT_APP_DESCRIPTION }}
REACT_APP_KEYWORDS: ${{ secrets.REACT_APP_KEYWORDS }}
REACT_APP_TITLE: ${{ secrets.REACT_APP_TITLE }}
我有一个名为.env
的文件,其中包含以下内容:
# PROJECT PUBLIC ENV'S
REACT_APP_TITLE = 'Web Instagram By Thiago De Bonis Carvalho Saad Saud'
REACT_APP_KEYWORDS = 'web instagram, instagram, thiago saud'
REACT_APP_AUTHOR = 'THIAGO DE BONIS CARVALHO SAAD SAUD'
REACT_APP_DESCRIPTION = 'Development of the copy of the Web Instagram for the purpose of gaining technical knowledge.'
{
"short_name": "%REACT_APP_TITLE%",
"name": "%REACT_APP_TITLE%",
"author": "%REACT_APP_AUTHOR%"
}
{
"name": "web-whatsapp",
"version": "0.0.0",
"private": true,
"description": "%REACT_APP_DESCRIPTION%",
"author": {
"name": "%REACT_APP_AUTHOR%",
"url": ""
}
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta name="keywords" content="%REACT_APP_KEYWORDS%" />
<meta name="author" content="%REACT_APP_AUTHOR%" />
<meta name="description" content="%REACT_APP_DESCRIPTION%" />
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<title>%REACT_APP_TITLE%</title>
</head>
</html>
我有一个名为manifest.json
的文件,其内容如下:
# PROJECT PUBLIC ENV'S
REACT_APP_TITLE = 'Web Instagram By Thiago De Bonis Carvalho Saad Saud'
REACT_APP_KEYWORDS = 'web instagram, instagram, thiago saud'
REACT_APP_AUTHOR = 'THIAGO DE BONIS CARVALHO SAAD SAUD'
REACT_APP_DESCRIPTION = 'Development of the copy of the Web Instagram for the purpose of gaining technical knowledge.'
{
"short_name": "%REACT_APP_TITLE%",
"name": "%REACT_APP_TITLE%",
"author": "%REACT_APP_AUTHOR%"
}
{
"name": "web-whatsapp",
"version": "0.0.0",
"private": true,
"description": "%REACT_APP_DESCRIPTION%",
"author": {
"name": "%REACT_APP_AUTHOR%",
"url": ""
}
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta name="keywords" content="%REACT_APP_KEYWORDS%" />
<meta name="author" content="%REACT_APP_AUTHOR%" />
<meta name="description" content="%REACT_APP_DESCRIPTION%" />
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<title>%REACT_APP_TITLE%</title>
</head>
</html>
我有一个package.json
文件,其中包含以下内容:
# PROJECT PUBLIC ENV'S
REACT_APP_TITLE = 'Web Instagram By Thiago De Bonis Carvalho Saad Saud'
REACT_APP_KEYWORDS = 'web instagram, instagram, thiago saud'
REACT_APP_AUTHOR = 'THIAGO DE BONIS CARVALHO SAAD SAUD'
REACT_APP_DESCRIPTION = 'Development of the copy of the Web Instagram for the purpose of gaining technical knowledge.'
{
"short_name": "%REACT_APP_TITLE%",
"name": "%REACT_APP_TITLE%",
"author": "%REACT_APP_AUTHOR%"
}
{
"name": "web-whatsapp",
"version": "0.0.0",
"private": true,
"description": "%REACT_APP_DESCRIPTION%",
"author": {
"name": "%REACT_APP_AUTHOR%",
"url": ""
}
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta name="keywords" content="%REACT_APP_KEYWORDS%" />
<meta name="author" content="%REACT_APP_AUTHOR%" />
<meta name="description" content="%REACT_APP_DESCRIPTION%" />
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<title>%REACT_APP_TITLE%</title>
</head>
</html>
我有一个HTML
文件,其中包含以下内容:
# PROJECT PUBLIC ENV'S
REACT_APP_TITLE = 'Web Instagram By Thiago De Bonis Carvalho Saad Saud'
REACT_APP_KEYWORDS = 'web instagram, instagram, thiago saud'
REACT_APP_AUTHOR = 'THIAGO DE BONIS CARVALHO SAAD SAUD'
REACT_APP_DESCRIPTION = 'Development of the copy of the Web Instagram for the purpose of gaining technical knowledge.'
{
"short_name": "%REACT_APP_TITLE%",
"name": "%REACT_APP_TITLE%",
"author": "%REACT_APP_AUTHOR%"
}
{
"name": "web-whatsapp",
"version": "0.0.0",
"private": true,
"description": "%REACT_APP_DESCRIPTION%",
"author": {
"name": "%REACT_APP_AUTHOR%",
"url": ""
}
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta name="keywords" content="%REACT_APP_KEYWORDS%" />
<meta name="author" content="%REACT_APP_AUTHOR%" />
<meta name="description" content="%REACT_APP_DESCRIPTION%" />
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<title>%REACT_APP_TITLE%</title>
</head>
</html>