Update main.yml #12
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 | |
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: sudo 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!🚀🚀🚀" |