How would you deploy just one file separately from the SPA that the SPA imports in a typical CI/CD pipeline? Would love to see a sample repo with either CircleCI/GithubActions/Netlify set up with a bundler like webpack/parcel/esbuild to demo this decoupling.
Usually, in a CI/CD environment, you will want to set the content of these files to some CI/CD environment variables. In these cases, you may use something like envsubst or its node equivalent envsub.
Example of this (docker environment, files served by nginx)
How would you deploy just one file separately from the SPA that the SPA imports in a typical CI/CD pipeline? Would love to see a sample repo with either CircleCI/GithubActions/Netlify set up with a bundler like webpack/parcel/esbuild to demo this decoupling.
Usually, in these cases, your bundler will output its results to a specific folder, ex:
dist
,www
,out
, etc.The minimum you need is a command that takes a file from one place and copies it there:
Then, you can deploy the resulting folder.
Usually, in a CI/CD environment, you will want to set the content of these files to some CI/CD environment variables. In these cases, you may use something like
envsubst
or its node equivalent envsub.Example of this (docker environment, files served by nginx)
entrypoint.sh:
Dockerfile: