Update react-ci-last.yml #3
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: CI-CD | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
build_test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
# Set up Node.js environment | |
- name: setup node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '14' # Change to your desired Node.js version | |
# Start Docker Compose | |
- name: Start Docker Compose | |
run: docker-compose up --build -d | |
# Install application dependencies | |
- name: Install dependencies | |
run: docker exec docker-react-c npm install --force | |
# Build the application | |
- name: Build | |
run: docker exec docker-react-c npm run build | |
# Run tests | |
- name: Run tests | |
run: docker exec docker-react-c npm test | |
# Stop Docker Compose after tests | |
- name: Stop Docker Compose | |
run: docker-compose down |