-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: infra-18574: Add .circleci and .infrastructure to have this app…
… build and deploy to bc infra
- Loading branch information
Showing
1 changed file
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
aliases: | ||
- &node_executor | ||
executor: | ||
name: node/node | ||
node-version: "18.20" | ||
|
||
version: 2.1 | ||
|
||
orbs: | ||
ci: bigcommerce/internal@volatile | ||
node: bigcommerce/internal-node@volatile | ||
security: bigcommerce/internal-security@volatile | ||
|
||
jobs: | ||
test: | ||
<<: *node_executor | ||
parallelism: 2 | ||
resource_class: medium+ | ||
steps: | ||
- ci/pre-setup | ||
- node/yarn-install | ||
- run: | ||
name: "Run unit tests for core package" | ||
command: | | ||
yarn test -- --runInBand | ||
lint: | ||
<<: *node_executor | ||
resource_class: medium+ | ||
steps: | ||
- ci/pre-setup | ||
- node/yarn-install | ||
- run: | ||
name: "Run lint" | ||
command: yarn run lint | ||
|
||
build_and_push: | ||
<<: *node_executor | ||
resource_class: medium+ | ||
steps: | ||
- ci/pre-setup | ||
- node/yarn-install | ||
- ci/gcloud_login | ||
- run: | ||
name: "Build distribution files" | ||
command: | | ||
# base64 -d <<<${{ secrets.ENV }} > apps/storefront/.env.${{ inputs.environment }} | ||
yarn build:production | ||
# echo "REVISION_TITLE=$(git rev-parse --short HEAD)-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}" >> $GITHUB_ENV | ||
# aws s3 cp apps/storefront/dist s3://b3-cdn-files/b2b/${{ inputs.environment }}/storefront --recursive --acl public-read | ||
mv apps/storefront/dist ${CIRCLE_SHA1} | ||
tar zcf ${CIRCLE_SHA1}.tar.gz ${CIRCLE_SHA1} | ||
|
||
workflows: | ||
version: 2 | ||
|
||
default: | ||
jobs: | ||
- test | ||
- lint | ||
- ci/validate-commits | ||
- build_and_push | ||
- ci/notify-success: | ||
context: "GCR + Artifact Bucket Access" | ||
requires: | ||
- ci/build_and_push |