Skip to content

Update main.yaml

Update main.yaml #4559

Workflow file for this run

name: CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop, 'feature/**']
jobs:
tests:
runs-on: ubuntu-latest
steps:
# Checkout the Repo
- uses: actions/checkout@v3
with:
fetch-depth: 0
# Install Node 18
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
- name : Npm Install
run: npm install
- name : Lint
run : npm run lint
- name : Test
run: npm test
- name : Check Path
run: ls -la && pwd && ls -la /
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
if: success() || failure()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
Test_Docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Build and push Docker images
run: |
docker-compose build --parallel
- name: Cache Docker Compose files
uses: actions/cache@v3
with:
path: ./path/to/your/compose/files
key: ${{ runner.os }}-docker-compose-${{ hashFiles('./compose.yaml') }}
restore-keys: |
${{ runner.os }}-docker-compose-
- name: Run Docker Compose
run: docker-compose up -d