peaceiris / actions-gh-pages

GitHub Actions for GitHub Pages 🚀 Deploy static files and publish your site easily. Static-Site-Generators-friendly.
https://github.com/marketplace/actions/github-pages-action
MIT License
4.53k stars 361 forks source link

support: action failed with "fetch first" hint #1078

Open raubel opened 1 month ago

raubel commented 1 month ago

Checklist

Describe your question

First of all, thanks for this awesome action !

I'm using it from a job with a matrix configuration, so the action may run concurrently.

Sometimes, it fails because the gh-pages branch is not up-to-date (see logs).

Any advice to prevent this?

Relevant links

My repository is private.

Relevant log output

Push the commit or tag
  /usr/bin/git push origin gh-pages
  To https://github.com/semarchy/mdm.git
   ! [rejected]        gh-pages -> gh-pages (fetch first)
  error: failed to push some refs to 'https://github.com/***/mdm.git'
  hint: Updates were rejected because the remote contains work that you do not
  hint: have locally. This is usually caused by another repository pushing to
  hint: the same ref. If you want to integrate the remote changes, use
  hint: 'git pull' before pushing again.
  hint: See the 'Note about fast-forwards' in 'git push --help' for details.
  Error: Action failed with "The process '/usr/bin/git' failed with exit code 1"

Additional context.

My matrix configuration:

      matrix:
        browser: [ chrome, firefox ]
        java_version: [ "17", "21" ]

How I have configured the step:

      - name: Upload report to GH Pages
        uses: peaceiris/actions-gh-pages@v4
        if: always()
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          publish_dir: playwright-report/
          destination_dir: "${{ env.TIMESTAMP }}/${{ matrix.browser }}/java${{ matrix.java_version }}/report"
raubel commented 1 month ago

Note that I see discussion here, but in my case I do want my jobs to run in parallel.

peaceiris commented 1 month ago

Thanks, this seems to be related to #759

raubel commented 1 month ago

Thank you, indeed, a retry mechanism would help. For now, I an using Wandalen retry action and it works fine.