diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 257fe950..e55c990b 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -2,7 +2,8 @@ name: Upload Preview Deployment on: workflow_run: - workflows: ['Build Preview Deployment'] + workflows: + - "Build Preview Deployment" types: - completed @@ -13,30 +14,31 @@ permissions: pull-requests: write jobs: - deploy-preview: + on-success: + runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.conclusion == 'success' }} + steps: + - name: Debug Event + run: | + echo "Event name: ${{ github.event_name }}" + echo "Workflow name: ${{ github.event.workflow.name }}" + echo "Workflow run id: ${{ github.event.workflow_run.id }}" + echo "Workflow run number: ${{ github.event.workflow_run.run_number }}" + echo "Workflow run conclusion: ${{ github.event.workflow_run.conclusion }}" + echo "Workflow run event: ${{ github.event.workflow_run.event }}" + + deploy-preview: + needs: on-success runs-on: ubuntu-latest - if: | - github.event.workflow_run.conclusion == 'success' && - github.event.workflow_run.head_repository.full_name == github.repository name: Deploy Preview to Cloudflare Pages steps: - - name: Debug Info - env: - EVENT_JSON: ${{ toJSON(github.event) }} - run: | - echo "Workflow Run ID: ${{ github.event.workflow_run.id }}" - echo "Event Type: ${{ github.event.workflow_run.event }}" - echo "Repository: ${{ github.event.workflow_run.head_repository.full_name }}" - echo "Full Event: $EVENT_JSON" - - name: Download artifacts - uses: dawidd6/action-download-artifact@v3 + uses: actions/download-artifact@v4 with: - workflow: Build Preview Deployment - run_id: ${{ github.event.workflow_run.id }} name: preview-build path: build - search_artifacts: true + github-token: ${{ secrets.GITHUB_TOKEN }} + run-id: ${{ github.event.workflow_run.id }} - name: List files run: ls -la build