actions netlify
v3.0.0
Netlifyに展開するための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 Production Deployとしての展開(デフォルト:FALSE)github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message
netlify deploymentで表示するカスタム展開メッセージ(例: ${{ github.event.pull_request.title }}
)enable-pull-request-comment: true
コメント(デフォルト:true)enable-commit-comment: true
コメント(デフォルト:true)enable-commit-status: true
githubコミットステータス(デフォルト:true)overwrites-pull-request-comment: true
Overwrites Pullリクエストに関するコメント(デフォルト:true)netlify-config-path: ./netlify.toml
netlify.toml
へのパス(default:undefined)functions-dir
netlify functions outputディレクトリ(デフォルト:未定義)alias
展開URLのプレフィックスを指定します。alias: ${{ github.head_ref }}
Branch Deploy Prefixを複製しますalias: deploy-preview-${{ github.event.number }}
deploy Previewプレフィックスを複製しますenable-github-deployment
(デフォルト:true)github-deployment-environment
環境Github展開の名前github-deployment-description
の説明fails-without-credentials
(デフォルト:false)すべてのパス(たとえば、 publish-dir
、 netlify-config-path
、 functions-dir
)は、プロジェクトのルートパスまたは絶対パスに関連しています。
deploy-url
netlifyによって生成された展開URL npm ci
npm run all