Use netlify action

This commit is contained in:
Hadley Wickham 2020-10-03 08:51:47 -05:00
parent caaf6cdac5
commit 39b53471c5
1 changed files with 15 additions and 4 deletions

View File

@ -4,6 +4,9 @@ on:
name: bookdown
env:
isExtPR: ${{ github.event.pull_request.head.repo.fork == true }}
jobs:
build:
runs-on: ubuntu-16.04
@ -66,10 +69,18 @@ jobs:
uses: actions/setup-node@v1
- name: Deploy to Netlify
# NETLIFY_AUTH_TOKEN and NETLIFY_SITE_ID added in the repo's secrets
if: contains(env.isExtPR, 'false')
id: netlify-deploy
uses: nwtgck/actions-netlify@v1.1
with:
publish-dir: './_book'
production-branch: master
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message:
'Deploy from GHA: ${{ github.event.pull_request.title || github.event.head_commit.message }} (${{ github.sha }})'
enable-pull-request-comment: false
enable-commit-comment: false
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
run: |
npm install netlify-cli -g
netlify deploy --prod --dir _book
timeout-minutes: 1