Skip to content

Commit

Permalink
Update deploy.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
akashyeole authored Jan 14, 2024
1 parent 2f89f3f commit 1d4c2cf
Showing 1 changed file with 16 additions and 21 deletions.
37 changes: 16 additions & 21 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,23 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Node.js CI
name: Push-to-EC2

on:
push:
branches: [ "main" ]
branches:
- main

jobs:
build:

runs-on: self-hosted

strategy:
matrix:
node-version: [21]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
deploy:
name: Deploy to EC2 on main branch push
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: sudo npm ci
- run: sudo npm run build:remote
- name: Checkout the files
uses: actions/checkout@v2

- name: Deploy to Server
uses: easingthemes/ssh-deploy@main
env:
SSH_PRIVATE_KEY: ${{ secrets.EC2_SSH_KEY }}
REMOTE_HOST: ${{ secrets.HOST_DNS }}
REMOTE_USER: ${{ secrets.USERNAME }}
TARGET: ${{ secrets.TARGET_DIR }}

0 comments on commit 1d4c2cf

Please sign in to comment.