For AI agents: the complete documentation index is available at /ja/llms.txt, the full documentation bundle is available at /ja/llms-full.txt, and this page is available as Markdown at /ja/guide/cleanup-deployments.md.
  • 日本語
  • 削除したブランチのDeploymentを削除する

    GitHubのブランチを削除したとき、そのブランチに紐づくVercelのDeploymentを自動的に削除できます。

    この機能はdeleteイベントかつcleanup-deploymenttrueに設定しなければ有効になりません。

    リポジトリの.github/workflows/cleanup-deployments.ymlに、次のワークフローを作成してください。

    name: Cleanup Vercel deployments
    
    on:
      delete:
    
    jobs:
      cleanup:
        if: ${{ github.event.ref_type == 'branch' }}
        name: Cleanup deployments
        runs-on: ubuntu-latest
    
        steps:
          - uses: nexterias/actions-vercel@v2
            with:
              token: ${{ secrets.VERCEL_TOKEN }}
              org-id: ${{ secrets.VERCEL_ORG_ID }}
              project-id: ${{ secrets.VERCEL_PROJECT_ID }}
              cleanup-deployment: true
    

    このワークフローファイルは、リポジトリのデフォルトブランチに配置してください。

    削除対象となるDeployment

    • 指定したVercel Projectから、削除したGitHubブランチに紐づくDeploymentを削除します。
    • Production Deploymentは削除しません。
    • タグの削除では、このワークフローは実行されません。