diff --git a/.github/workflows/CD.yml b/.github/workflows/CD.yml new file mode 100644 index 0000000..46c19a4 --- /dev/null +++ b/.github/workflows/CD.yml @@ -0,0 +1,76 @@ +name: CD + +on: +  pull_request: +    branches: [ "main" ] + +  workflow_dispatch: + +jobs: +  stats: +    name: PR Stats +    runs-on: ubuntu-latest + +    steps: + +      - name: Checkout repository +        uses: actions/checkout@v3 + +  + +      - name: Set up Node.js 16.x +        uses: actions/setup-node@v3 +        with: +          node-version: 16.x + +  + +      - name: Install dependencies +        run: npm install + +  + +      - name: Run the tests +        run: npm run test -- --coverage +        env: +          CI: true + +  + +      - name: SonarCloud Scan +        uses: SonarSource/sonarcloud-github-action@master +        env: +          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +          SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} +      - name: Setup Pages + +  + +        uses: actions/configure-pages@v3 + +  + + +      - name: Upload artifact + +  + +        uses: actions/upload-pages-artifact@v1 + +  + +        with: + +  + +          path: 'pre-hackathon-devops-grupo1/src' + +      - name: Deploy to GitHub Pages + +  + +        id: deployment + +  + +        uses: actions/deploy-pages@v2 diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 0000000..035eff1 --- /dev/null +++ b/.github/workflows/CI.yml @@ -0,0 +1,55 @@ +name: CI + +on: + pull_request: + branches: [ "main" ] + + workflow_dispatch: + +jobs: + stats: + name: PR Stats + runs-on: ubuntu-latest + + steps: + + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up Node.js 16.x + uses: actions/setup-node@v3 + with: + node-version: 16.x + + - name: Install dependencies + run: npm install + + - name: Run the tests + run: npm run test -- --coverage + env: + CI: true + + - name: SonarCloud Scan + uses: SonarSource/sonarcloud-github-action@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + - name: Setup Pages + + uses: actions/configure-pages@v3 + + + - name: Upload artifact + + uses: actions/upload-pages-artifact@v1 + + with: + + path: 'build' + + + - name: Deploy to GitHub Pages + + id: deployment + + uses: actions/deploy-pages@v2