Skip to content

Commit

Permalink
Correct node.js.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
ShrujanaReddy committed Aug 9, 2024
1 parent b48c11c commit 3219976
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,26 @@ jobs:
uses: actions/[email protected]

- name: Build Docker image
run: docker-compose build
run: docker compose build

- name: Run Docker Compose file
run: docker-compose up -d && sleep 10
run: docker compose up -d && sleep 10

- name: Run unit tests
run: docker-compose run --rm app npm test
run: docker compose run --rm app npm test

- name: Run integration tests
run: |
docker-compose run --rm app npx sequelize-cli db:drop
docker-compose run --rm app npx sequelize-cli db:create
docker-compose run --rm app npx sequelize-cli db:migrate
docker-compose run --rm app npm run start:dev &
docker compose run --rm app npx sequelize-cli db:drop
docker compose run --rm app npx sequelize-cli db:create
docker compose run --rm app npx sequelize-cli db:migrate
docker compose run --rm app npm run start:dev &
sleep 10
docker-compose run --rm app npm install cypress cypress-json-results
docker-compose run --rm app npx cypress run
docker compose run --rm app npm install cypress cypress-json-results
docker compose run --rm app npx cypress run
- name: Stop and remove Docker containers
run: docker-compose down
run: docker compose down

- name: Setup SSH
run: |
Expand All @@ -50,7 +50,7 @@ jobs:
username: ${{ secrets.SERVER_USER }}
key: ${{ secrets.SERVER_SSH_KEY }}
script: |
docker pull your-docker-repo/todo-app:latest
docker pull todo-app:latest
docker stop todo-app || true
docker rm todo-app || true
docker run -d --name todo-app -p 80:80 your-docker-repo/todo-app:latest
docker run -d --name todo-app -p 80:80 todo-app:latest

0 comments on commit 3219976

Please sign in to comment.