Skip to content

Commit

Permalink
Move common setup to reusable workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
MrBartusek committed Nov 22, 2023
1 parent f11bbec commit e6191bd
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 15 deletions.
17 changes: 2 additions & 15 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,8 @@ jobs:
name: Setup Environment
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v3
- name: Set up Node 18
uses: actions/setup-node@v3
with:
node-version: 18
- name: Cache NPM dependencies
uses: actions/cache@v3
id: cache-npm
with:
path: node_modules
key: ${{ runner.os }}-npm-${{ hashFiles('package-lock.json') }}
- name: Install dependencies
if: steps.cache-npm.outputs.cache-hit != 'true'
run: npm ci
- name: Use Common Setup
uses: common-setup.yml

build:
name: Build
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/common-setup.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Common Setup

on:
workflow_run:
workflows: ["*"]

jobs:
setup:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v3
- name: Set up Node 18
uses: actions/setup-node@v3
with:
node-version: 18
- name: Cache NPM dependencies
uses: actions/cache@v3
id: cache-npm
with:
path: node_modules
key: ${{ runner.os }}-npm-${{ hashFiles('package-lock.json') }}
- name: Install dependencies
if: steps.cache-npm.outputs.cache-hit != 'true'
run: npm ci

0 comments on commit e6191bd

Please sign in to comment.