Merge pull request #59 from ashishb1052002/main #298
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: Deploy to Netlify on pull requests | |
on: [push, workflow_dispatch] | |
env: | |
node_version: 16.x | |
jobs: | |
environment: | |
name: 🌱 Load Environment | |
runs-on: ubuntu-latest | |
steps: | |
- name: ⚙️ Node.js version used - ${{ env.node_version }} | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ env.node_version }} | |
build: | |
runs-on: ubuntu-latest | |
needs: [environment] | |
steps: | |
# Checkout repo | |
- uses: actions/checkout@v2 | |
- name: Prepare | |
run: npm ci | |
- name: Install Netlify | |
run: npm i netlify-cli | |
- name: Build site | |
run: npm run build | |
# Deploy the site with netlify-cli | |
- name: Deploy Site | |
env: | |
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} | |
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
run: netlify deploy --dir=build --alias=$GITHUB_SHA --message=$GITHUB_SHA |