title: Deploy code directly to AWS EC2 instance using Github Actions
body: <p>As the title says I am trying to deploy my <strong>Laravel-Angular</strong> application directly from <strong>Github</strong> to <strong>AWS EC2</strong> instance using <strong>Github Actions</strong>.</p>
  
  <p>In my application there are 3 <strong>Angular 8+</strong> projects which are needed to be build before deployment. Where as laravel does not need to be build.</p>
  
  <p>The solutions that are available suggests to use <strong>AWS Elastic Beanstalk</strong> to deploy code. But, if that is to be done how to attach an elastic beanstalk to an existing instance is not clear enough.</p>
  
  <p>Is there a way to deploy code to <strong>AWS EC2</strong> without using <strong>Elastic Beanstalk</strong>?</p>
  
  <p>Here is my <strong>Github Actions</strong> build.yml :</p>
  
  <pre><code>name: Build Develop Branch
  
  on:
    push:
      branches: [ develop ]
    pull_request:
      branches: [ develop ]
  
  jobs:
    build:
  
      runs-on: ubuntu-latest
  
      strategy:
        matrix:
          node-version: [14.x]
  
      steps:
      - name: Code Checkout
        uses: actions/checkout@v2
      - name: Use Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v1
        with:
          node-version: ${{ matrix.node-version }}
      - name: App 1 npm install
        run: npm install
        working-directory: angular-app-1
      - name: App 1 Build
        run: npm run build:staging
        working-directory: angular-app-1
      - name: App 2 npm install
        run: npm install
        working-directory: angular-app-2
      - name: App 2 Build
        run: node node_modules/@angular/cli/bin/ng build --configuration=staging
        working-directory: angular-app-2
      - name: App 3 npm install
        run: npm install
        working-directory: angular-app-3
      - name: App 3 Build
        run: node node_modules/@angular/cli/bin/ng build --configuration=staging
        working-directory: angular-app-3
  </code></pre>