Skip to content

Commit

Permalink
feat: infra-18574: Add .circleci and .infrastructure to have this app…
Browse files Browse the repository at this point in the history
… build and deploy to bc infra
  • Loading branch information
xyzjace committed Oct 1, 2024
1 parent 07db48d commit 81ffe04
Showing 1 changed file with 66 additions and 0 deletions.
66 changes: 66 additions & 0 deletions .circleci/config.yml
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

0 comments on commit 81ffe04

Please sign in to comment.