GitHub Action for deploying static site on Netlify or Vercel via build hook. Skips deployment if no changes are detected.
MIT License
This GitHub Action deploys your static site to Netlify or Vercel by triggering a build hook from the convenience of your GitHub repository. You can also set it up to run by cron.
The Action will skip deployment when no changes are detected since the last run. To store the commit id of the current deployment GitHub cache mechanism is used.
You can also pass always_deploy
set to true
to trigger deployment without checking for changes.
To obtain build hook URL:
https://api.netlify.com/build_hooks/12345679abcdef
. You shouldn't share it with anyone else. I recommend saving it in Secrets and variables section of your GitHub repository settings.name: Deploy static site
on:
workflow_dispatch:
jobs:
DeploySite:
runs-on: ubuntu-latest
steps:
- name: Deploy site
uses: lwojcik/github-action-deploy-static-site@v1
with:
platform: netlify
netlify_deploy_hook_url: ${{ secrets.NETLIFY_DEPLOY_HOOK_URL }}
# always_deploy: true - if you want to skip checking for changes
To disable automatic builds and obtain build hook URL:
https://api.vercel.com/v1/integrations/deploy/12345679abcdef
. You shouldn't share it with anyone else. I recommend saving it in Secrets and variables section of your GitHub repository settings.name: Deploy static site
on:
workflow_dispatch:
jobs:
DeploySite:
runs-on: ubuntu-latest
steps:
- name: Deploy site
uses: lwojcik/github-action-deploy-static-site@v1
with:
platform: vercel
vercel_deploy_hook_url: ${{ secrets.VERCEL_DEPLOY_HOOK_URL }}
# always_deploy: true - if you want to skip checking for changes
Licensed under MIT License. See LICENSE for more information.