We have a pipeline that is doing double duty by deploying to both a staging environment and production. To accomplish this our pipeline has the following steps:
- Build staging .env file
- Build application for staging
- Deploy staging
- Build production .env file
- Build application for production
- Deploy production.
My question has to do with the fact that both steps 1 and 4 create artifacts called ".env". When step 2 runs, there's only one .env file artifact but there are potentially 2 when step 5 runs. Are artifacts overwritten when they have the same name or what? How can I be sure that step five uses the artifacts from step 4?