Use netlify action
This commit is contained in:
parent
caaf6cdac5
commit
39b53471c5
|
@ -4,6 +4,9 @@ on:
|
||||||
|
|
||||||
name: bookdown
|
name: bookdown
|
||||||
|
|
||||||
|
env:
|
||||||
|
isExtPR: ${{ github.event.pull_request.head.repo.fork == true }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-16.04
|
runs-on: ubuntu-16.04
|
||||||
|
@ -66,10 +69,18 @@ jobs:
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v1
|
||||||
|
|
||||||
- name: Deploy to Netlify
|
- 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:
|
env:
|
||||||
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
||||||
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
|
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
|
||||||
run: |
|
timeout-minutes: 1
|
||||||
npm install netlify-cli -g
|
|
||||||
netlify deploy --prod --dir _book
|
|
||||||
|
|
Loading…
Reference in New Issue