name: Update Sites After Release Main

on:
  push:
    branches:
      - main
  workflow_dispatch:
    
permissions:
  contents: write
  packages: write

jobs:
  update-sites:
    uses: psdevteamenterprise/ci-workflows/.github/workflows/update-and-notify.yml@main
    with:
     sites_to_update: "[{repo: 'psdevteamenterprise/tests-site', secret: 'WIX_PS_API_KEY'},
                        {repo: 'psdevteamenterprise/external-template', secret: 'WIX_SR_API_KEY'},
                        {repo: 'psdevteamenterprise/internal', secret: 'WIX_SR_API_KEY'}]"
    
    secrets:
      GH_TOKEN: ${{ secrets.GH_TOKEN }}
      NPM_TOKEN: ${{ secrets.PS_NPM_TOKEN }}
      GH_APP_ID: ${{ secrets.GH_APP_ID }}
      GH_APP_PRIVATE_KEY: ${{ secrets.GH_APP_PRIVATE_KEY }}
      WIX_PS_API_KEY: ${{ secrets.WIX_PS_API_KEY }}
      WIX_SR_API_KEY: ${{ secrets.WIX_SR_API_KEY }}