orchid00 / actions_sandbox

https://ropenscilabs.github.io/actions_sandbox/
Other
17 stars 6 forks source link

Update to Cecilapp/GitHub-Pages-deploy@v3 #40

Closed stephan-koenig closed 3 years ago

stephan-koenig commented 3 years ago

Hi,

The previous version of deploy_bookdowm.yml used Cecilapp/GitHub-Pages-deploy@master, but the action changed with this latest version, Cecilapp/GitHub-Pages-deploy@v3. The action now uses GITHUB_TOKEN and input parameters, see:

https://github.com/Cecilapp/GitHub-Pages-deploy/blob/12981df74c347334d5b2f178d116c00092bf34f8/README.md

As a result, the previous version of deploy_bookdown.yml currently fails with the error cp: can't stat '_site/*': No such file or directory because environmental variable BUILD_DIR must now be provided as input parameter build_dir.

Another possible solution is to specify the previous version of the action with Cecilapp/GitHub-Pages-deploy@v2, which still exclusively uses environment variables.

Best,

Stephan

stephan-koenig commented 3 years ago

I just realized that this PR addresses issue #39.

lachlandeer commented 3 years ago

one could also move to v3 by changing checkout-and-deploy step as follows:

# Need to first create an empty gh-pages branch
# see https://pkgdown.r-lib.org/reference/deploy_site_github.html
# and also add secrets for a GH_PAT and EMAIL to the repository
# gh-action from Cecilapp/GitHub-Pages-deploy
  checkout-and-deploy:
   runs-on: ubuntu-latest
   needs: bookdown
   steps:
     - name: Checkout
       uses: actions/checkout@master
     - name: Download artifact
       uses: actions/download-artifact@v1.0.0
       with:
         # Artifact name
         name: _book # optional
         # Destination path
         path: _book # optional
     - name: Deploy to GitHub Pages
       uses: Cecilapp/GitHub-Pages-deploy@v3
       with:
          build_dir: _book/
          email: ${{ secrets.EMAIL }}
       env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
stephan-koenig commented 3 years ago

Agreed, my PR switches to v3.