Read the related article on Medium.
Last active
April 19, 2020 14:04
-
-
Save hormesiel/ca024785824461486402c89cca1f8b30 to your computer and use it in GitHub Desktop.
GitHub Action to automatically rebuild and redeploy a website to ZEIT Now whenever content is edited in the CMS.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build & Deploy to Production | |
# Run when a dispatch event is created (e.g. from a CMS Webhook) | |
# See https://developer.github.com/v3/repos/#create-a-repository-dispatch-event | |
on: [repository_dispatch] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 # Equivalent to `git checkout master` | |
- name: Install dependencies | |
run: yarn | |
- name: Build | |
run: yarn build | |
- name: Deploy | |
run: now _build/ --prod -t ${{ secrets.ZEIT_TOKEN }} | |
# The `_build/` argument is optional. In my case it's the directory where `yarn build` puts the final code to | |
# deploy. If you want to deploy the current directory instead, just remove this argument. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment