Skip to content

Commit

Permalink
ci: deploy docs to netlify as part of build github action
Browse files Browse the repository at this point in the history
  • Loading branch information
bchew committed Jul 26, 2021
1 parent f786a39 commit a3ad8d5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build
name: Build and Deploy

on:
push:
Expand All @@ -22,6 +22,14 @@ jobs:
- run: npm -v
- run: npm ci
- run: npm run dist
- name: Deploy docs to Netlify
run: |
# Truncate branch name at 37 characters per alias requirement: https://cli.netlify.com/commands/deploy/
BRANCH_NAME=${{github.head_ref}}
BRANCH_NAME=${BRANCH_NAME:0:37}
NETLIFY_AUTH_TOKEN=${{secrets.NETLIFY_AUTH_TOKEN}} NETLIFY_SITE_ID=${{secrets.NETLIFY_SITE_ID}} \
npx netlify-cli deploy --dir=docs --message="${BRANCH_NAME}" --alias="${BRANCH_NAME}"
- name: Notify Slack channel
if: always() && job.status != 'success' && github.ref == 'refs/heads/master'
env:
Expand Down

0 comments on commit a3ad8d5

Please sign in to comment.