Skip to content

Commit

Permalink
Fixed workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
WISNIOM committed Jan 8, 2025
1 parent 00fb742 commit 299bd6c
Showing 1 changed file with 40 additions and 15 deletions.
55 changes: 40 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,19 @@ jobs:
with:
node-version: "18"

- name: Restore node_modules
uses: actions/download-artifact@v3
- name: Cache node_modules
id: cache-node-modules
uses: actions/cache@v3
with:
name: node_modules
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node_modules-
- name: Install dependencies
run: npm ci
if: steps.cache-node-modules.outputs.cache-hit != 'true'

- name: Run tests
run: npm test
build:
Expand All @@ -67,20 +75,29 @@ jobs:
with:
node-version: "18"

- name: Restore node_modules
uses: actions/download-artifact@v3
- name: Cache node_modules
id: cache-node-modules
uses: actions/cache@v3
with:
name: node_modules
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node_modules-
- name: Install dependencies
run: npm ci
if: steps.cache-node-modules.outputs.cache-hit != 'true'

- name: Build project
run: npm run build

- name: Save dist folder
- name: Upload build artifact
uses: actions/upload-artifact@v3
with:
name: dist
path: dist
name: dist-files
path: |
dist
!dist/**/*:Zone.Identifier
run:
runs-on: ubuntu-latest
needs: build
Expand All @@ -93,17 +110,25 @@ jobs:
with:
node-version: "18"

- name: Restore node_modules
uses: actions/download-artifact@v3
- name: Cache node_modules
id: cache-node-modules
uses: actions/cache@v3
with:
name: node_modules
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node_modules-
- name: Install dependencies
run: npm ci
if: steps.cache-node-modules.outputs.cache-hit != 'true'

- name: Restore dist folder
- name: Get build artifacts
uses: actions/download-artifact@v3
with:
name: dist
path: dist
name: dist-files
- name: Output contents
run: ls

- name: Run main file
run: node dist/app.js

0 comments on commit 299bd6c

Please sign in to comment.