Skip to content

Commit

Permalink
Merge pull request #216 from hngprojects/change-deploy-scripts-to-pnpm
Browse files Browse the repository at this point in the history
Change deploy scripts to pnpm
  • Loading branch information
Ravencodess authored Jul 20, 2024
2 parents a8665b4 + 1bfdfc8 commit 09ccef9
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 28 deletions.
20 changes: 11 additions & 9 deletions .github/workflows/dev-cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,27 @@ jobs:
with:
node-version: '20'

- name: Cache npm modules
- name: Cache pnpm modules
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
path: ~/.pnpm-store
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-npm-
${{ runner.os }}-pnpm-
- name: Install npm
run: npm install -g npm@9
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: Install dependencies
run: npm install
run: pnpm install

- name: Lint code
run: npm run lint
run: pnpm lint

- name: Build project
run: npm run build
run: pnpm build

deploy:
runs-on: ubuntu-latest
Expand Down
21 changes: 11 additions & 10 deletions .github/workflows/prod-cicd.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

name: Production CI/CD Pipeline

on:
Expand All @@ -25,25 +24,27 @@ jobs:
with:
node-version: '20'

- name: Cache npm modules
- name: Cache pnpm modules
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
path: ~/.pnpm-store
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-npm-
${{ runner.os }}-pnpm-
- name: Install npm
run: npm install -g npm@9
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: Install dependencies
run: npm install
run: pnpm install

- name: Lint code
run: npm run lint
run: pnpm run lint

- name: Build project
run: npm run build
run: pnpm run build

deploy:
runs-on: ubuntu-latest
Expand Down
20 changes: 11 additions & 9 deletions .github/workflows/staging-cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,27 @@ jobs:
with:
node-version: '20'

- name: Cache npm modules
- name: Cache pnpm modules
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
path: ~/.pnpm-store
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-npm-
${{ runner.os }}-pnpm-
- name: Install npm
run: npm install -g npm@9
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: Install dependencies
run: npm install
run: pnpm install

- name: Lint code
run: npm run lint
run: pnpm run lint

- name: Build project
run: npm run build
run: pnpm run build

deploy:
runs-on: ubuntu-latest
Expand Down

0 comments on commit 09ccef9

Please sign in to comment.