From 78cc158e68cc3046edabaeeeca6741076a7d3651 Mon Sep 17 00:00:00 2001 From: "Jyotirmoy Bandyopadhyaya [Bravo68]" Date: Sat, 25 Nov 2023 03:53:13 +0530 Subject: [PATCH] fix: github actions --- .github/actions/setup/action.yml | 32 ++++++++++++++++++++++++++++++++ .github/workflows/build.yaml | 19 +++++++++++++++++++ .github/workflows/lint.yaml | 26 -------------------------- 3 files changed, 51 insertions(+), 26 deletions(-) create mode 100644 .github/actions/setup/action.yml create mode 100644 .github/workflows/build.yaml delete mode 100644 .github/workflows/lint.yaml diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml new file mode 100644 index 0000000..f126ce6 --- /dev/null +++ b/.github/actions/setup/action.yml @@ -0,0 +1,32 @@ +name: Setup Node Environment +description: Prepare and install everything for nodejs repo + +runs: + using: composite + steps: + - uses: pnpm/action-setup@v2 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + cache: pnpm + node-version: 18 + registry-url: https://registry.npmjs.org/ + + - name: Install dependencies + shell: bash + run: pnpm i + + - name: Restore Turborepo Cache + uses: actions/cache@v3 + with: + path: | + apps/**/.turbo + node_modules/.cache/turbo + key: turbo-${{ runner.os }}-${{ github.job }}-${{ github.sha }} + restore-keys: | + turbo-${{ runner.os }}-${{ github.job }} + + - name: Build packages + shell: bash + run: pnpm build \ No newline at end of file diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..6f9b6a0 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,19 @@ +name: Build Checks + +on: + push: + branches: [main, dev] + pull_request: + branches: [main, dev] + workflow_dispatch: + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Setup Environment + uses: ./.github/actions/setup \ No newline at end of file diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml deleted file mode 100644 index 37c4632..0000000 --- a/.github/workflows/lint.yaml +++ /dev/null @@ -1,26 +0,0 @@ -name: Build Checks for Dashboard - -on: - push: - pull_request: - workflow_dispatch: - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Setup Node - uses: actions/setup-node@v1 - with: - node-version: 16 - - name: Install Yarn - run: npm install -g yarn - - name: Install Dependencies - run: yarn install --frozen-lockfile - - name: Lint - run: yarn lint - - name: Build - run: yarn build