name: CD

on:
  workflow_run:
    workflows: [CI]
    types: [completed]
    branches: [master]

permissions:
  contents: read

jobs:
  release:
    if: >-
      github.event.workflow_run.conclusion == 'success' &&
      github.event.workflow_run.event == 'push' &&
      github.event.workflow_run.head_branch == 'master' &&
      github.event.workflow_run.head_repository.full_name == github.repository
    uses: Raruto/Raruto/.github/workflows/cd.yml@master
    permissions:
      contents: write
      id-token: write
    with:
      branch: ${{ github.event.workflow_run.head_branch }}
      head-sha: ${{ github.event.workflow_run.head_sha }}
