diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 2038e0b..90e6410 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -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 }}