To add Github Actions for deployment and deploy content to Netlify on merge to the main branch, we can create a workflow file named deploy.yml in the .github/workflows directory. Here's an example of the content for the deploy.yml file:
name: Deploy to Netlify
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Build and Deploy
uses: nwtgck/actions-netlify@v1.4.0
with:
publish-dir: ./public
access-token: ${{ secrets.NETLIFY_ACCESS_TOKEN }}
To add Github Actions for deployment and deploy content to Netlify on merge to the main branch, we can create a workflow file named
deploy.yml
in the.github/workflows
directory. Here's an example of the content for thedeploy.yml
file: