forked from PinSpace-Org/GistPin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcache-strategy.yml
More file actions
73 lines (63 loc) 路 2.02 KB
/
Copy pathcache-strategy.yml
File metadata and controls
73 lines (63 loc) 路 2.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: Artifact Caching Strategy
on:
pull_request:
push:
branches: [main]
workflow_dispatch:
jobs:
cache-validation:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Cache npm dependencies
uses: actions/cache@v4
with:
path: |
~/.npm
**/node_modules
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
- name: Cache Cargo dependencies
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
contracts/target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Install dependencies
run: |
npm ci
[ -f Frontend/package.json ] && (cd Frontend && npm ci) || true
[ -f Backend/package.json ] && (cd Backend && npm ci) || true
[ -f analytics/package.json ] && (cd analytics && npm ci) || true
- name: Build project artifacts
run: |
[ -f Frontend/package.json ] && (cd Frontend && npm run build) || true
[ -f Backend/package.json ] && (cd Backend && npm run build) || true
[ -f analytics/package.json ] && (cd analytics && npm run build) || true
- name: Save artifact cache
uses: actions/cache@v4
with:
path: |
Frontend/dist
Backend/dist
analytics/dist
key: ${{ runner.os }}-artifacts-${{ github.sha }}