Merge pull request #27 from github-usman/client-home #32
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: FRONTEND Continuous Deployment | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 # Fetch all history for all branches and tags | |
- name: Use Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: "18.x" | |
- name: Install dependencies | |
run: | | |
cd frontend | |
npm install | |
- name: Build | |
run: | | |
cd frontend | |
npm run build | |
- name: Install Netlify CLI | |
run: npm install -g netlify-cli | |
- name: Deploy to Netlify | |
if: github.ref == 'refs/heads/master' # Deploy only on master branch | |
env: | |
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
NETLIFY_SITE_ID: ${{secrets.NETLIFY_SITE_ID}} | |
run: | | |
cd frontend | |
netlify deploy --prod --dir=build --site=${NETLIFY_SITE_ID} --message="Deployed from GitHub Actions" |