|
47 | 47 | # Upload just the public folder |
48 | 48 | path: 'public' |
49 | 49 | - name: Deploy to GitHub Pages |
| 50 | + if: github.event.pull_request.head.repo.full_name == github.repository |
50 | 51 | id: deployment |
51 | 52 | uses: actions/deploy-pages@v4 |
| 53 | + |
| 54 | + - name: Set up Git user |
| 55 | + if: github.event.pull_request.head.repo.full_name != github.repository |
| 56 | + run: | |
| 57 | + git config user.name "l5io" |
| 58 | + git config user.email "l5io@users.noreply.github.com" |
| 59 | + - name: Push branch to master repo |
| 60 | + if: github.event.pull_request.head.repo.full_name != github.repository |
| 61 | + run: | |
| 62 | + git remote add main-origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git |
| 63 | + git push main-origin HEAD:refs/heads/pr-preview/${{ github.event.pull_request.number }} --force |
| 64 | +
|
| 65 | +
|
52 | 66 | - name: Comment Preview URL on PR |
53 | 67 | if: github.event_name == 'pull_request' |
54 | 68 | uses: marocchino/sticky-pull-request-comment@v2 |
|
61 | 75 | > 📖 General Preview: ${{ steps.deployment.outputs.page_url }} |
62 | 76 | |
63 | 77 | This preview will be updated automatically when you push new commits to this PR. |
| 78 | +
|
| 79 | +
|
| 80 | +
|
| 81 | +
|
| 82 | +
|
| 83 | +
|
| 84 | +
|
| 85 | +
|
| 86 | +
|
| 87 | + # mirror-fork-pr: |
| 88 | + # if: github.event.pull_request.head.repo.full_name != github.repository |
| 89 | + # environment: |
| 90 | + # name: pr-preview-${{ github.event.pull_request.number || github.run_id }} |
| 91 | + # # url: ${{ steps.deployment.outputs.page_url }} |
| 92 | + # runs-on: ubuntu-latest |
| 93 | + # steps: |
| 94 | + # - name: Checkout PR branch |
| 95 | + # uses: actions/checkout@v4 |
| 96 | + # with: |
| 97 | + # ref: ${{ github.event.pull_request.head.ref }} |
| 98 | + # repository: ${{ github.event.pull_request.head.repo.full_name }} |
0 commit comments