Created
December 26, 2019 02:27
-
-
Save dance2die/f8e95f917db03c6880acd5934cbb8cbd to your computer and use it in GitHub Desktop.
Building Gatsby with GitHub Actions and deploying to Netlify
This file contains hidden or 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 and Deploy to Gatsby every hour | |
on: | |
schedule: | |
- cron: '0 */2 * * *' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
# https://github.com/actions/setup-node#usage | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: '12.x' | |
- run: npm install | |
- run: npm run build | |
# Deploy the gatsby build to Netlify | |
- uses: netlify/actions/cli@master | |
env: | |
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} | |
with: | |
args: deploy --dir=public --prod | |
secrets: '["NETLIFY_AUTH_TOKEN", "NETLIFY_SITE_ID"]' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment