Skip to content

yaml syntax correction #5

yaml syntax correction

yaml syntax correction #5

# run node-mongo app inside container and let job interact with app
# job running inside container
name: Checkout and run nodejs app inside container
on: push
defaults:
run:
working-directory: ./nodejs-docker
jobs:
build:
env:
MONGO_HOSTNAME: ${{ secrets.MONGO_HOSTNAME }}
MONGO_USERNAME: ${{ secrets.MONGO_USERNAME }}
MONGO_PWD: ${{ secrets.MONGO_PWD }}
runs-on: ubuntu-latest
container:
image: node:18
steps:
- name: Get Code
uses: actions/checkout@v4
- name: Folder content
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
run: npm ci
- name: Run server
run: |
npm start & npx wait-on http://localhost:3000
- name: Get users
run: curl http://localhost:3000/users