name: CI on: [push, pull_request] jobs: build_css: runs-on: ubuntu-latest if: "!contains(github.event.head_commit.message, 'NO_CI')" steps: - uses: actions/checkout@v2 - name: Setup Node uses: actions/setup-node@v1 with: node-version: '12.x' - name: Cache dependencies id: npm-cache run: | echo "::set-output name=dir::$(npm config get cache)" - uses: actions/cache@v2 with: path: ${{ steps.npm-cache.outputs.dir }} key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} restore-keys: ${{ runner.os }}-node - name: Install dependencies run: npm ci - name: Compile CSS run: npm run scss - name: Check for modified files id: git-check run: echo ::set-output name=modified::$(if git diff-index --quiet HEAD -- *.{scss,css}; then echo "false"; else echo "true"; fi) - name: Push changes if: steps.git-check.outputs.modified == 'true' run: | git config --global user.name 'Build Bot' git config --global user.email 'build.bot@karaka.app' git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} git add *.css git commit -m "Automatic css build" || true git push || true linting: runs-on: ubuntu-latest if: "!contains(github.event.head_commit.message, 'NO_CI')" strategy: fail-fast: false max-parallel: 3 steps: - name: Checkout Repository uses: actions/checkout@main with: fetch-depth: 0 submodules: recursive token: ${{ secrets.GH_PAT }} - name: Lint Code Base uses: github/super-linter/slim@v4 env: VALIDATE_ALL_CODEBASE: false VALIDATE_CSS : true DEFAULT_BRANCH: develop GITHUB_TOKEN: ${{ secrets.GH_PAT }}