Hi,
I have a NX monorepo that I want to build and deploy to firebase in pipelines.
NX provides a build affected command that only builds the new changes made to the repo. However, I need the entire build compiled to deploy to firebase. Therefore, I am trying to cache the build in bitbucket. The build dist is not a part of the repo. How do I cache the folder between deploying, and can I have separate cache for building to dev and prod?
definitions:
caches:
my-bundler-cache:
key:
files:
- dist
path: dist
steps:
- step: &deploy
caches:
- node
- my-bundler-cache
script:
- npm ci
- npm install -g firebase-tools
- npx nx workspace-lint
- npx nx format:check
# - npx nx run-many --target=build --all --configuration="$NX_ENVIRONMENT" #used first time building
- npx nx affected --target=lint --base=origin/master --parallel & npx nx affected --target=test --base=HEAD~1 --parallel --configuration="$NX_ENVIRONMENT" & npx nx affected --target=build --base=HEAD~1 --parallel
- firebase deploy --only hosting --project="$NX_ENVIRONMENT" --token "$BITBUCKET_FIREBASE_TOKEN"
d
File structure:
