diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml new file mode 100644 index 0000000..1bdfdcc --- /dev/null +++ b/.github/actions/setup/action.yml @@ -0,0 +1,27 @@ +name: 'Setup' +runs: + using: 'composite' + steps: + - name: Install pnpm + uses: pnpm/action-setup@v4 + + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version-file: '.node-version' + cache: 'pnpm' + # This creates an .npmrc that reads the NODE_AUTH_TOKEN environment variable + # necessary for publish + registry-url: 'https://registry.npmjs.org' + + - name: Install dependencies + run: pnpm install + shell: bash + + - name: Build Theme + run: pnpm build + working-directory: theme + + - name: Build Tina + run: pnpm exec tinacms build --local --skip-cloud-checks + working-directory: web diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 893b6bf..68ef5ed 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,13 +23,9 @@ jobs: name: Lint (JS) runs-on: ubuntu-latest steps: + - uses: actions/checkout@v4 - name: Setup - uses: wyvox/action@v1 - - # build tina stuff - - name: Build Tina - run: pnpm exec tinacms build --local --skip-cloud-checks - working-directory: web + uses: ./.github/actions/setup - name: Lint run: pnpm run lint:js @@ -39,16 +35,23 @@ jobs: name: Lint (Types) runs-on: ubuntu-latest steps: + - uses: actions/checkout@v4 - name: Setup - uses: wyvox/action@v1 + uses: ./.github/actions/setup - # build tina stuff - - name: Build Tina - run: pnpm exec tinacms build --local --skip-cloud-checks + - name: Lint + run: pnpm run lint:types working-directory: web + lint-css: + name: Lint (CSS) + runs-on: ubuntu-latest + steps: + - name: Setup + uses: ./.github/actions/setup + - name: Lint - run: pnpm run lint:types + run: pnpm run lint:css working-directory: web lint-hbs: @@ -56,12 +59,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Setup - uses: wyvox/action@v1 - - # build tina stuff - - name: Build Tina - run: pnpm exec tinacms build --local --skip-cloud-checks - working-directory: web + uses: ./.github/actions/setup - name: Lint run: pnpm run lint:hbs @@ -72,12 +70,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Setup - uses: wyvox/action@v1 - - # build tina stuff - - name: Build Tina - run: pnpm exec tinacms build --local --skip-cloud-checks - working-directory: web + uses: ./.github/actions/setup # - name: Lint JS # run: pnpm run -r --parallel --aggregate-output lint:js