Skip to content

Update gadgetPlus.deployment.yaml #2

Update gadgetPlus.deployment.yaml

Update gadgetPlus.deployment.yaml #2

name: GadgetPlus
on:
push:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Install dependencies
run: npm install
- name: Build
run: npm run build
- name: Start
run: npm start
- name: Deploy to AWS EC2 using ssh
uses: appleboy/ssh-action@v0.1.4
with:
host: ${{ secrets.EC2_PUBLIC_IP }}
username: ubuntu
key: ${{ secrets.EC2_SSH_PRIVATE_KEY }}
script: |
echo "Connected to AWS EC2 instance"
# cd ~/home/danielwetan/apps/node1
git pull origin master
git status
npm install
pm2 start app.js