checkout code + run app in runner #1
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: Checkout and run nodejs app inside runner(VM) | |
on: | |
push: | |
branches: | |
- job-in-container | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get Code | |
uses: actions/checkout@v4 | |
- name: Folder content | |
working-directory: ./nodejs-docker | |
run: ls | |
- name: Cache dependencies | |
uses: actions/cache@v4 | |
with: | |
path: ~/.npm | |
key: deps-node-modules-${{ hashFiles('./nodejs-docker/package-lock.json') }} | |
- name: Install dependencies | |
working-directory: ./nodejs-docker | |
run: npm ci | |
- name: Install dependencies | |
working-directory: ./nodejs-docker | |
run: npm ci | |
- name: Run server | |
working-directory: ./nodejs-docker | |
run: | | |
npm start | |
- name: Get users | |
run: curl http://localhost:3000/users |