Open kucherenko opened 1 year ago
Implement task #84 - add github actions for deployment
To add GitHub Actions for deployment and deploy content to Netlify on merge to the main branch, we need to create a workflow file in the .github/workflows
directory of the repository.
The workflow will trigger on each push to the main branch and perform the deployment to Netlify. We can use the on
keyword to define the trigger event, and the jobs
section to define the steps and actions to be executed.
Here's an example of a workflow file to achieve this:
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@master
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: <Netlify Site ID>
BUILD_COMMAND: npm run build
PUBLISH_DIRECTORY: <build output directory>
Make sure to replace <Netlify Site ID>
with your actual Netlify site ID and <build output directory>
with the directory where your built files are located.
The workflow uses the actions/checkout
action to fetch the latest code from the main branch. Then, it uses the nwtgck/actions-netlify
action to build and deploy the project to Netlify.
Note that you need to set up a secret named NETLIFY_AUTH_TOKEN
in your GitHub repository settings, which should contain a personal access token with the necessary permissions to deploy to your Netlify site.
After implementing this workflow file, any push to the main branch will trigger the deployment to Netlify.
Implement task #84 - add github actions for deployment
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 }}
Implement task #84 - add github actions for deployment
To add GitHub Actions for deployment and deploy content to Netlify on merge to the main branch, we need to create a YAML file for GitHub Actions workflow. We can name this file as deploy.yml
and place it inside the .github/workflows
directory of the repository.
Add github action for deploy content to netlify on merge to main branch.
/ai:go(variants=3)