Skip to content

Update main.yml

Update main.yml #5

Workflow file for this run

name: CI/CD Pipeline
on:
push:
branches: [ "master" ]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Debug: List repo files after checkout

Check failure on line 15 in .github/workflows/main.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/main.yml

Invalid workflow file

You have an error in your yaml syntax on line 15
run: ls -la
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Install dependencies
run: |
cd app
npm install
- name: Run tests
run: |
cd app
npm test
- name: Log in to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build Docker image
run: docker build -t ${{ secrets.DOCKER_USERNAME }}/nodejs-docker-cicd .
- name: Push Docker image
run: docker push ${{ secrets.DOCKER_USERNAME }}/nodejs-docker-cicd