Skip to content

Update main.yml

Update main.yml #9

Workflow file for this run

name: Deploy
on:
push:
branches:
- main
env:
CI: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: 18
- name: Install dependencies
run: npm install
- name: Build
run: npm run build
- name: Generate PEM
run: echo "$PEM" >> tcp.pem && chmod 400 tcp.pem
env:
PEM: ${{secrets.PEM}}
- name: Copy build folder contents to server
run: scp -o StrictHostKeyChecking=no -i tcp.pem -r build/* [email protected]:~/home/CodeUtsava7.0/build
- name: Doing the magic now
run: ssh -i tcp.pem [email protected] "sudo systemctl restart ngnix"
- name: LIVE!!!
run: echo "Site is Live!🚀🚀🚀"