lcolladotor / biocthis

Automate package and project setup for Bioconductor packages
https://lcolladotor.github.io/biocthis/
50 stars 17 forks source link

[BUG] Deploy action using JamesIves/github-pages-deploy-action #31

Closed lmweber closed 2 years ago

lmweber commented 2 years ago

Hi @lcolladotor , I'm not completely sure if this is the right place for this, but I found out there have been some changes to GitHub permissions / authentication affecting the deploy action with JamesIves/github-pages-deploy-action that we had in the OSTA GitHub Actions workflow.

Specifically, the line

uses: JamesIves/github-pages-deploy-action@releases/v3

needs to be updated to v4:

uses: JamesIves/github-pages-deploy-action@releases/v4

to use the latest version where @JamesIves has updated this.

I suspect the fix is in the updated handling of permissions in this release, although I'm not completely sure: https://github.com/JamesIves/github-pages-deploy-action/releases/tag/v4.3.3

Then, to use v4, some of the syntax for the action has also changed, specifically: with: token (lower-case token instead of GITHUB_TOKEN), and also lower-case for with: branch and with: folder. These changes are described in the release notes / migration guide here: https://github.com/JamesIves/github-pages-deploy-action/discussions/592

So now my Deploy action looks like this, which seems to be working:

      - name: Deploy šŸš€
        if: github.ref == 'refs/heads/main' && runner.os == 'Linux'
        uses: JamesIves/github-pages-deploy-action@releases/v4
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          branch: gh-pages # The branch the action should deploy to.
          folder: _book # The folder the action should deploy.

vs. the old version that no longer worked:

      - name: Deploy šŸš€
        if: github.ref == 'refs/heads/main' && runner.os == 'Linux'
        uses: JamesIves/github-pages-deploy-action@releases/v3
        with:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          BRANCH: gh-pages # The branch the action should deploy to.
          FOLDER: _book # The folder the action should deploy.

Here is also the error I was getting with v3 previously:

Screen Shot 2022-07-06 at 01 40 02

Also tagging @stephaniehicks for info.

Thank you!!

lcolladotor commented 2 years ago

Thanks Lukas! Though this is not part of biocthis. It's part of some other GitHub actions workflows you and I have used elsewhere. It's great to know about it though, so thanks for sharing the news here =)

Best, Leo