actions netlify
v3.0.0
用于部署的github动作
部署URL会对您的拉请请求发表评论并提交评论!
GitHub部署也得到了支持!
# .github/workflows/netlify.yml
name : Build and Deploy to Netlify
on :
push :
pull_request :
jobs :
build :
runs-on : ubuntu-22.04
steps :
- uses : actions/checkout@v4
# ( Build to ./dist or other directory... )
- name : Deploy to Netlify
uses : nwtgck/[email protected]
with :
publish-dir : ' ./dist '
production-branch : master
github-token : ${{ secrets.GITHUB_TOKEN }}
deploy-message : " Deploy from GitHub Actions "
enable-pull-request-comment : false
enable-commit-comment : true
overwrites-pull-request-comment : true
env :
NETLIFY_AUTH_TOKEN : ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID : ${{ secrets.NETLIFY_SITE_ID }}
timeout-minutes : 1
publish-dir
(例如“ dist”,“ _site”)NETLIFY_AUTH_TOKEN
:个人访问令牌>新的访问令牌NETLIFY_SITE_ID
:团队页面>您的网站>设置>站点详细信息>站点信息> API IDNETLIFY_SITE_ID
。production-branch
(例如“大师”)production-deploy
:部署为NetLify生产部署(默认:false)github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message
自定义部署消息将在NetLify部署(例如${{ github.event.pull_request.title }}
)上查看enable-pull-request-comment: true
注释(默认:true)enable-commit-comment: true
评论(默认:true)enable-commit-status: true
github commit状态(默认:true)overwrites-pull-request-comment: true
覆盖注释(默认:true)netlify-config-path: ./netlify.toml
to netlify.toml
(默认:undefined)functions-dir
netlify函数输出目录(默认:未定义)alias
指定部署URL的前缀,不得具有大写或特殊字符(默认值:NetLify build ID)alias: ${{ github.head_ref }}
复制分支部署前缀alias: deploy-preview-${{ github.event.number }}
复制部署预览前缀enable-github-deployment
是否要部署到github(默认:true)github-deployment-environment
名称GitHub部署的名称github-deployment-description
GitHub部署的描述fails-without-credentials
而失败(默认:false)所有路径(例如, publish-dir
, netlify-config-path
, functions-dir
)均相对于项目的根或绝对路径。
deploy-url
npm ci
npm run all