mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 22:40:14 -05:00
Configured storing Nx cache in GHA to speed up builds
refs https://github.com/TryGhost/DevOps/issues/47 - this allows us to store and restore the cache for TS builds, which should speed up the whole process
This commit is contained in:
parent
0be06f0237
commit
e990cbba01
3 changed files with 18 additions and 2 deletions
14
.github/workflows/ci.yml
vendored
14
.github/workflows/ci.yml
vendored
|
@ -20,6 +20,10 @@ env:
|
||||||
~/.cache/ms-playwright/
|
~/.cache/ms-playwright/
|
||||||
CACHED_BUILD_PATHS: |
|
CACHED_BUILD_PATHS: |
|
||||||
${{ github.workspace }}/ghost/*/build
|
${{ github.workspace }}/ghost/*/build
|
||||||
|
NX_CACHE_RESTORE_KEYS: |
|
||||||
|
nx-Linux-${{ github.ref }}-${{ github.sha }}
|
||||||
|
nx-Linux-${{ github.ref }}
|
||||||
|
nx-Linux
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.head_ref || github.run_id }}
|
group: ${{ github.head_ref || github.run_id }}
|
||||||
|
@ -100,7 +104,7 @@ jobs:
|
||||||
changed_any_code: ${{ steps.changed.outputs.any-code }}
|
changed_any_code: ${{ steps.changed.outputs.any-code }}
|
||||||
base_commit: ${{ env.BASE_COMMIT }}
|
base_commit: ${{ env.BASE_COMMIT }}
|
||||||
is_canary_branch: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/arch') }}
|
is_canary_branch: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/arch') }}
|
||||||
is_git_sync: ${{ github.head_ref == 'main' || github.ref == 'refs/heads/main' }}
|
is_main: ${{ github.ref == 'refs/heads/main' }}
|
||||||
|
|
||||||
job_install_deps:
|
job_install_deps:
|
||||||
name: Install Dependencies
|
name: Install Dependencies
|
||||||
|
@ -117,6 +121,14 @@ jobs:
|
||||||
id: compute_lockfile_hash
|
id: compute_lockfile_hash
|
||||||
run: echo "hash=${{ hashFiles('yarn.lock') }}" >> "$GITHUB_OUTPUT"
|
run: echo "hash=${{ hashFiles('yarn.lock') }}" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
- name: Nx cache
|
||||||
|
uses: actions/cache@v3
|
||||||
|
id: cache_nx
|
||||||
|
with:
|
||||||
|
path: .nxcache
|
||||||
|
key: nx-Linux-${{ github.ref }}-${{ env.HEAD_COMMIT }}
|
||||||
|
restore-keys: ${{needs.job_get_metadata.outputs.is_main == 'false' && env.NX_CACHE_RESTORE_KEYS || 'nx-never-restore'}}
|
||||||
|
|
||||||
- name: Check dependency cache
|
- name: Check dependency cache
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
id: cache_dependencies
|
id: cache_dependencies
|
||||||
|
|
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -48,6 +48,9 @@ typings/
|
||||||
# Optional npm cache directory
|
# Optional npm cache directory
|
||||||
.npm
|
.npm
|
||||||
|
|
||||||
|
# Nx cache
|
||||||
|
.nxcache
|
||||||
|
|
||||||
# Optional eslint cache
|
# Optional eslint cache
|
||||||
.eslintcache
|
.eslintcache
|
||||||
|
|
||||||
|
|
3
nx.json
3
nx.json
|
@ -8,7 +8,8 @@
|
||||||
"lint",
|
"lint",
|
||||||
"test",
|
"test",
|
||||||
"test:unit"
|
"test:unit"
|
||||||
]
|
],
|
||||||
|
"cacheDirectory": ".nxcache"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue