From 6d5b583cd273841e2fe518bf1068b55c2528a73e Mon Sep 17 00:00:00 2001 From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com> Date: Thu, 11 Mar 2021 11:38:01 -0500 Subject: [PATCH 01/20] ci(travis): Remove travis, add codespell github action --- .github/workflows/codespell.yml | 16 ++++++++++++++++ .travis.yml | 29 ----------------------------- 2 files changed, 16 insertions(+), 29 deletions(-) create mode 100644 .github/workflows/codespell.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml new file mode 100644 index 0000000..407f03c --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,16 @@ +# GitHub Action to automate the identification of common misspellings in text files. +# https://github.com/codespell-project/actions-codespell +# https://github.com/codespell-project/codespell +name: codespell +on: pull_request +jobs: + codespell: + name: Check for spelling errors + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: codespell-project/actions-codespell@master + with: + check_filenames: true + only_warn: 1 + skip: ./.git,yarn.lock,./stories/data/* \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 2ab2a57..0000000 --- a/.travis.yml +++ /dev/null @@ -1,29 +0,0 @@ -sudo: false -language: node_js -cache: - yarn: true -notifications: - email: false -node_js: - - '12' -# Install AWS CLI for uploading storybook to S3. -before_install: - - pyenv global 3.7.1 - - pip install -U pip - - pip install awscli - # add aws 'default' profile for uploading storybook - - mkdir ~/.aws && printf '%s\n' '[default]' "aws_access_key_id=${AWS_ACCESS_KEY_ID}" "aws_secret_access_key=${AWS_SECRET_ACCESS_KEY}" 'region=us-east-1' > ~/.aws/config -install: - - yarn -script: - - npm run lint - - npm run cover -after_success: - - bash <(curl -s https://codecov.io/bash) - - semantic-release - # Deploy storybook demo to S3 if handling a non-PR build on the main branch - # https://s3.amazonaws.com/transitive.js/index.html - - if [ "$TRAVIS_BRANCH" = "master" -a "$TRAVIS_PULL_REQUEST" = "false" ]; then yarn deploy-storybook; else echo 'skipping deploy to s3'; fi -branches: - except: - - /^v\d+\.\d+\.\d+$/ From aea4e7513998a21ff395bdfd5131cce3253fb581 Mon Sep 17 00:00:00 2001 From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com> Date: Thu, 11 Mar 2021 12:03:34 -0500 Subject: [PATCH 02/20] ci(CI): Add CI workflow (without AWS at this time) --- .github/workflows/node-ci.yml | 49 +++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/node-ci.yml diff --git a/.github/workflows/node-ci.yml b/.github/workflows/node-ci.yml new file mode 100644 index 0000000..e8712cb --- /dev/null +++ b/.github/workflows/node-ci.yml @@ -0,0 +1,49 @@ +name: Node.js CI + +on: + push: + branches: + - master + pull_request: + +jobs: + test-build-release: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Use Node.js 12.x + uses: actions/setup-node@v1 + with: + node-version: 12.x + - name: Install npm packages using cache + uses: bahmutov/npm-install@v1 + + # Install AWS CLI for uploading storybook to S3 + #- name: Install PyEnv Global + # run: pyenv global 3.7.1 ## + #- name: Install pip + # run: pip install -U pip + #- name: Install AWS CLI + # run: pip install awscli + + - name: Lint code + run: yarn lint + - name: Run tests with coverage + run: yarn cover + + # at this point, the build is successful + - name: Codecov + uses: codecov/codecov-action@v1.2.0 + continue-on-error: true + - name: Semantic Release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + run: semantic-release + + # Deploy storybook demo to S3 if handling a non-PR build on the main branch + # https://s3.amazonaws.com/transitive.js/index.html + #- name: Deploy storybook to S3 + # run: if [ "$TRAVIS_BRANCH" = "master" -a "$TRAVIS_PULL_REQUEST" = "false" ]; then yarn deploy-storybook; else echo 'skipping deploy to s3'; fi From a71596e218076699a561a07dc526d17302c3338b Mon Sep 17 00:00:00 2001 From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com> Date: Thu, 11 Mar 2021 15:53:01 -0500 Subject: [PATCH 03/20] ci(gh-actions): Add deploy to AWS for testing. --- .github/workflows/node-ci.yml | 38 ++++++++++++++++++++--------------- package.json | 2 +- 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/.github/workflows/node-ci.yml b/.github/workflows/node-ci.yml index e8712cb..50dfb58 100644 --- a/.github/workflows/node-ci.yml +++ b/.github/workflows/node-ci.yml @@ -19,15 +19,6 @@ jobs: node-version: 12.x - name: Install npm packages using cache uses: bahmutov/npm-install@v1 - - # Install AWS CLI for uploading storybook to S3 - #- name: Install PyEnv Global - # run: pyenv global 3.7.1 ## - #- name: Install pip - # run: pip install -U pip - #- name: Install AWS CLI - # run: pip install awscli - - name: Lint code run: yarn lint - name: Run tests with coverage @@ -37,13 +28,28 @@ jobs: - name: Codecov uses: codecov/codecov-action@v1.2.0 continue-on-error: true - - name: Semantic Release + #- name: Semantic Release + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + # run: yarn semantic-release + + - name: Add AWS credentials + run: mkdir ~/.aws && printf '%s\n' '[default]' 'aws_access_key_id=${AWS_ACCESS_KEY_ID}' 'aws_secret_access_key=${AWS_SECRET_ACCESS_KEY}' 'region=${AWS_REGION}' > ~/.aws/config env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - run: semantic-release - + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_REGION: ${{ secrets.AWS_REGION }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + # Install AWS CLI v1 for uploading storybook to S3 + # (AWS CLI v2 does not come with a non-sudo installer as of writing) + - name: Set up Python (default to latest 3.x) + uses: actions/setup-python@v2 + - name: Install pip + run: pip install -U pip + - name: Install AWS CLI v1 + run: pip install awscli # Deploy storybook demo to S3 if handling a non-PR build on the main branch # https://s3.amazonaws.com/transitive.js/index.html - #- name: Deploy storybook to S3 - # run: if [ "$TRAVIS_BRANCH" = "master" -a "$TRAVIS_PULL_REQUEST" = "false" ]; then yarn deploy-storybook; else echo 'skipping deploy to s3'; fi + - name: Deploy storybook to S3 + if: ${{ github.event.issue.pull_request }} + run: yarn deploy-storybook diff --git a/package.json b/package.json index dbf855c..bd7df1a 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "lint": "mastarm lint lib", "semantic-release": "semantic-release pre && npm publish && semantic-release post", "start": "start-storybook -p 5555", - "deploy-storybook": "storybook-to-aws-s3 --bucket-path=transitive.js --s3-sync-options=--acl=public-read" + "deploy-storybook": "storybook-to-aws-s3 --bucket-path=bdam-testbuckt --s3-sync-options=--acl=public-read" }, "devDependencies": { "@babel/core": "^7.12.3", From 2f87266d9e5ebdc21108b7e1d5643bf81832a01a Mon Sep 17 00:00:00 2001 From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com> Date: Thu, 11 Mar 2021 16:04:11 -0500 Subject: [PATCH 04/20] ci(gh action/ci): Fix s3 upload test --- .github/workflows/node-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node-ci.yml b/.github/workflows/node-ci.yml index 50dfb58..c4f5c52 100644 --- a/.github/workflows/node-ci.yml +++ b/.github/workflows/node-ci.yml @@ -51,5 +51,5 @@ jobs: # Deploy storybook demo to S3 if handling a non-PR build on the main branch # https://s3.amazonaws.com/transitive.js/index.html - name: Deploy storybook to S3 - if: ${{ github.event.issue.pull_request }} + if: ${{ github.event.pull_request }} run: yarn deploy-storybook From 0ff2fa1071acd365cb4d971679703eb27f95a711 Mon Sep 17 00:00:00 2001 From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com> Date: Thu, 11 Mar 2021 16:19:51 -0500 Subject: [PATCH 05/20] ci(node-ci.yml): Attempt to fix AWS region --- .github/workflows/node-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node-ci.yml b/.github/workflows/node-ci.yml index c4f5c52..9bd9932 100644 --- a/.github/workflows/node-ci.yml +++ b/.github/workflows/node-ci.yml @@ -35,7 +35,7 @@ jobs: # run: yarn semantic-release - name: Add AWS credentials - run: mkdir ~/.aws && printf '%s\n' '[default]' 'aws_access_key_id=${AWS_ACCESS_KEY_ID}' 'aws_secret_access_key=${AWS_SECRET_ACCESS_KEY}' 'region=${AWS_REGION}' > ~/.aws/config + run: mkdir ~/.aws && printf '%s\n' '[default]' 'aws_access_key_id=${AWS_ACCESS_KEY_ID}' 'aws_secret_access_key=${AWS_SECRET_ACCESS_KEY}' 'region=us-east-1' > ~/.aws/config env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_REGION: ${{ secrets.AWS_REGION }} From 00c3a48a9fff04044c2b830aaca72935537146a1 Mon Sep 17 00:00:00 2001 From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com> Date: Thu, 11 Mar 2021 16:28:42 -0500 Subject: [PATCH 06/20] ci(node-ci.yml): Fix macros for env variables. --- .github/workflows/node-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node-ci.yml b/.github/workflows/node-ci.yml index 9bd9932..8d68ff3 100644 --- a/.github/workflows/node-ci.yml +++ b/.github/workflows/node-ci.yml @@ -35,7 +35,7 @@ jobs: # run: yarn semantic-release - name: Add AWS credentials - run: mkdir ~/.aws && printf '%s\n' '[default]' 'aws_access_key_id=${AWS_ACCESS_KEY_ID}' 'aws_secret_access_key=${AWS_SECRET_ACCESS_KEY}' 'region=us-east-1' > ~/.aws/config + run: mkdir ~/.aws && printf '%s\n' '[default]' 'aws_access_key_id=$AWS_ACCESS_KEY_ID' 'aws_secret_access_key=$AWS_SECRET_ACCESS_KEY' 'region=$AWS_REGION' > ~/.aws/config env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_REGION: ${{ secrets.AWS_REGION }} From 4bc63455e893629fbcbe9432678dca1d4491cc6e Mon Sep 17 00:00:00 2001 From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com> Date: Thu, 11 Mar 2021 16:39:29 -0500 Subject: [PATCH 07/20] ci(node-ci.yml): Fix macros for env variables (again) --- .github/workflows/node-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node-ci.yml b/.github/workflows/node-ci.yml index 8d68ff3..5645b62 100644 --- a/.github/workflows/node-ci.yml +++ b/.github/workflows/node-ci.yml @@ -35,7 +35,7 @@ jobs: # run: yarn semantic-release - name: Add AWS credentials - run: mkdir ~/.aws && printf '%s\n' '[default]' 'aws_access_key_id=$AWS_ACCESS_KEY_ID' 'aws_secret_access_key=$AWS_SECRET_ACCESS_KEY' 'region=$AWS_REGION' > ~/.aws/config + run: mkdir ~/.aws && printf '%s\n' '[default]' "aws_access_key_id=$AWS_ACCESS_KEY_ID" "aws_secret_access_key=$AWS_SECRET_ACCESS_KEY" "region=$AWS_REGION" > ~/.aws/config env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_REGION: ${{ secrets.AWS_REGION }} From ea6a38db85c41ae7007a3fe5895eb5b764f4e562 Mon Sep 17 00:00:00 2001 From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com> Date: Thu, 11 Mar 2021 16:44:17 -0500 Subject: [PATCH 08/20] ci(node-ci.yml): Print AWS region --- .github/workflows/node-ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/node-ci.yml b/.github/workflows/node-ci.yml index 5645b62..ed98b11 100644 --- a/.github/workflows/node-ci.yml +++ b/.github/workflows/node-ci.yml @@ -34,6 +34,10 @@ jobs: # NPM_TOKEN: ${{ secrets.NPM_TOKEN }} # run: yarn semantic-release + - name: AWS region? + run: echo "region=$AWS_REGION" + env: + AWS_REGION: ${{ secrets.AWS_REGION }} - name: Add AWS credentials run: mkdir ~/.aws && printf '%s\n' '[default]' "aws_access_key_id=$AWS_ACCESS_KEY_ID" "aws_secret_access_key=$AWS_SECRET_ACCESS_KEY" "region=$AWS_REGION" > ~/.aws/config env: From 1961fd76dff2fa45280279ba21d0f6c3377c4b9f Mon Sep 17 00:00:00 2001 From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com> Date: Thu, 11 Mar 2021 17:05:42 -0500 Subject: [PATCH 09/20] ci(node-ci.yml): Add semantic, conditions for s3 deploy. --- .github/workflows/node-ci.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/node-ci.yml b/.github/workflows/node-ci.yml index ed98b11..48aaf92 100644 --- a/.github/workflows/node-ci.yml +++ b/.github/workflows/node-ci.yml @@ -28,17 +28,14 @@ jobs: - name: Codecov uses: codecov/codecov-action@v1.2.0 continue-on-error: true - #- name: Semantic Release - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - # run: yarn semantic-release - - - name: AWS region? - run: echo "region=$AWS_REGION" + - name: Semantic Release env: - AWS_REGION: ${{ secrets.AWS_REGION }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + run: yarn semantic-release + - name: Add AWS credentials + if: ${{ github.event.push && github.ref == 'refs/heads/main' }} run: mkdir ~/.aws && printf '%s\n' '[default]' "aws_access_key_id=$AWS_ACCESS_KEY_ID" "aws_secret_access_key=$AWS_SECRET_ACCESS_KEY" "region=$AWS_REGION" > ~/.aws/config env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} @@ -47,13 +44,16 @@ jobs: # Install AWS CLI v1 for uploading storybook to S3 # (AWS CLI v2 does not come with a non-sudo installer as of writing) - name: Set up Python (default to latest 3.x) + if: ${{ github.event.push && github.ref == 'refs/heads/main' }} uses: actions/setup-python@v2 - name: Install pip + if: ${{ github.event.push && github.ref == 'refs/heads/main' }} run: pip install -U pip - name: Install AWS CLI v1 + if: ${{ github.event.push && github.ref == 'refs/heads/main' }} run: pip install awscli - # Deploy storybook demo to S3 if handling a non-PR build on the main branch + # Deploy storybook demo to S3 if handling a push (non-PR build) on the main branch # https://s3.amazonaws.com/transitive.js/index.html - name: Deploy storybook to S3 - if: ${{ github.event.pull_request }} + if: ${{ github.event.push && github.ref == 'refs/heads/main' }} run: yarn deploy-storybook From 28dc97ffae5f674b5dc4b8f3ae9b6919adee52bd Mon Sep 17 00:00:00 2001 From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com> Date: Thu, 11 Mar 2021 17:16:57 -0500 Subject: [PATCH 10/20] ci(package.json): Fix semantic script, revert s3 bucket to original. --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index bd7df1a..5625061 100644 --- a/package.json +++ b/package.json @@ -30,9 +30,9 @@ "prepublish": "mastarm prepublish lib:build", "cover": "npm test -- --coverage", "lint": "mastarm lint lib", - "semantic-release": "semantic-release pre && npm publish && semantic-release post", + "semantic-release": "semantic-release", "start": "start-storybook -p 5555", - "deploy-storybook": "storybook-to-aws-s3 --bucket-path=bdam-testbuckt --s3-sync-options=--acl=public-read" + "deploy-storybook": "storybook-to-aws-s3 --bucket-path=transitive.js --s3-sync-options=--acl=public-read" }, "devDependencies": { "@babel/core": "^7.12.3", From b3c9d6df45e309f98f798388a0266fd5e5764afa Mon Sep 17 00:00:00 2001 From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com> Date: Thu, 11 Mar 2021 17:30:54 -0500 Subject: [PATCH 11/20] ci(node-ci.yml): Extract env var for push-to-master. --- .github/workflows/node-ci.yml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/node-ci.yml b/.github/workflows/node-ci.yml index 48aaf92..8bdc3f0 100644 --- a/.github/workflows/node-ci.yml +++ b/.github/workflows/node-ci.yml @@ -8,6 +8,8 @@ on: jobs: test-build-release: + env: + IS_PUSH_TO_MASTER: ${{ github.event.push && github.ref == 'refs/heads/main' }} runs-on: ubuntu-latest @@ -34,26 +36,28 @@ jobs: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} run: yarn semantic-release + # Steps below deal with uploading Storybook to S3, + # which is only performed with a push to the main branch. - name: Add AWS credentials - if: ${{ github.event.push && github.ref == 'refs/heads/main' }} + if: $IS_PUSH_TO_MASTER run: mkdir ~/.aws && printf '%s\n' '[default]' "aws_access_key_id=$AWS_ACCESS_KEY_ID" "aws_secret_access_key=$AWS_SECRET_ACCESS_KEY" "region=$AWS_REGION" > ~/.aws/config env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_REGION: ${{ secrets.AWS_REGION }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - # Install AWS CLI v1 for uploading storybook to S3 - # (AWS CLI v2 does not come with a non-sudo installer as of writing) - - name: Set up Python (default to latest 3.x) - if: ${{ github.event.push && github.ref == 'refs/heads/main' }} + # Install AWS CLI v1 using pip for uploading storybook to S3 + # (AWS CLI v2 does not come with a non-sudo installer as of writing). + - name: Set up Python (latest 3.x) + if: $IS_PUSH_TO_MASTER uses: actions/setup-python@v2 - name: Install pip - if: ${{ github.event.push && github.ref == 'refs/heads/main' }} + if: $IS_PUSH_TO_MASTER run: pip install -U pip - name: Install AWS CLI v1 - if: ${{ github.event.push && github.ref == 'refs/heads/main' }} + if: $IS_PUSH_TO_MASTER run: pip install awscli # Deploy storybook demo to S3 if handling a push (non-PR build) on the main branch # https://s3.amazonaws.com/transitive.js/index.html - name: Deploy storybook to S3 - if: ${{ github.event.push && github.ref == 'refs/heads/main' }} + if: $IS_PUSH_TO_MASTER run: yarn deploy-storybook From 70c258f4cfd1d6f98a4e20cbd60b0e3ab9a705a7 Mon Sep 17 00:00:00 2001 From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com> Date: Thu, 11 Mar 2021 17:39:22 -0500 Subject: [PATCH 12/20] ci(node-ci,yml): Fix macros --- .github/workflows/node-ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/node-ci.yml b/.github/workflows/node-ci.yml index 8bdc3f0..a3ba8d6 100644 --- a/.github/workflows/node-ci.yml +++ b/.github/workflows/node-ci.yml @@ -39,7 +39,7 @@ jobs: # Steps below deal with uploading Storybook to S3, # which is only performed with a push to the main branch. - name: Add AWS credentials - if: $IS_PUSH_TO_MASTER + if: ${{ env.IS_PUSH_TO_MASTER }} run: mkdir ~/.aws && printf '%s\n' '[default]' "aws_access_key_id=$AWS_ACCESS_KEY_ID" "aws_secret_access_key=$AWS_SECRET_ACCESS_KEY" "region=$AWS_REGION" > ~/.aws/config env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} @@ -48,16 +48,16 @@ jobs: # Install AWS CLI v1 using pip for uploading storybook to S3 # (AWS CLI v2 does not come with a non-sudo installer as of writing). - name: Set up Python (latest 3.x) - if: $IS_PUSH_TO_MASTER + if: ${{ env.IS_PUSH_TO_MASTER }} uses: actions/setup-python@v2 - name: Install pip - if: $IS_PUSH_TO_MASTER + if: ${{ env.IS_PUSH_TO_MASTER }} run: pip install -U pip - name: Install AWS CLI v1 - if: $IS_PUSH_TO_MASTER + if: ${{ env.IS_PUSH_TO_MASTER }} run: pip install awscli # Deploy storybook demo to S3 if handling a push (non-PR build) on the main branch # https://s3.amazonaws.com/transitive.js/index.html - name: Deploy storybook to S3 - if: $IS_PUSH_TO_MASTER + if: ${{ env.IS_PUSH_TO_MASTER }} run: yarn deploy-storybook From 2a826d6ead65a21adf2ebb6990814ee2b8bdb44b Mon Sep 17 00:00:00 2001 From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com> Date: Fri, 12 Mar 2021 14:26:57 -0500 Subject: [PATCH 13/20] ci(node-ci.yml): Check whether AWSCLI is installed by default on ubuntu-latest --- .github/workflows/node-ci.yml | 20 ++++++++++---------- package.json | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/node-ci.yml b/.github/workflows/node-ci.yml index a3ba8d6..1d93062 100644 --- a/.github/workflows/node-ci.yml +++ b/.github/workflows/node-ci.yml @@ -9,7 +9,7 @@ on: jobs: test-build-release: env: - IS_PUSH_TO_MASTER: ${{ github.event.push && github.ref == 'refs/heads/main' }} + IS_PUSH_TO_MASTER: true # ${{ github.event.push && github.ref == 'refs/heads/main' }} runs-on: ubuntu-latest @@ -47,15 +47,15 @@ jobs: AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} # Install AWS CLI v1 using pip for uploading storybook to S3 # (AWS CLI v2 does not come with a non-sudo installer as of writing). - - name: Set up Python (latest 3.x) - if: ${{ env.IS_PUSH_TO_MASTER }} - uses: actions/setup-python@v2 - - name: Install pip - if: ${{ env.IS_PUSH_TO_MASTER }} - run: pip install -U pip - - name: Install AWS CLI v1 - if: ${{ env.IS_PUSH_TO_MASTER }} - run: pip install awscli + #- name: Set up Python (latest 3.x) + # if: ${{ env.IS_PUSH_TO_MASTER }} + # uses: actions/setup-python@v2 + #- name: Install pip + # if: ${{ env.IS_PUSH_TO_MASTER }} + # run: pip install -U pip + #- name: Install AWS CLI v1 + # if: ${{ env.IS_PUSH_TO_MASTER }} + # run: pip install awscli # Deploy storybook demo to S3 if handling a push (non-PR build) on the main branch # https://s3.amazonaws.com/transitive.js/index.html - name: Deploy storybook to S3 diff --git a/package.json b/package.json index 5625061..0195b96 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "lint": "mastarm lint lib", "semantic-release": "semantic-release", "start": "start-storybook -p 5555", - "deploy-storybook": "storybook-to-aws-s3 --bucket-path=transitive.js --s3-sync-options=--acl=public-read" + "deploy-storybook": "storybook-to-aws-s3 --bucket-path=bdam-testbuckt --s3-sync-options=--acl=public-read" }, "devDependencies": { "@babel/core": "^7.12.3", From 68ed8c08c96275e2753f68386ec6a9afade89f29 Mon Sep 17 00:00:00 2001 From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com> Date: Fri, 12 Mar 2021 15:37:09 -0500 Subject: [PATCH 14/20] ci(node-ci.yml): Revert S3 deploy condition to push to master. --- .github/workflows/node-ci.yml | 15 +++------------ package.json | 2 +- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/.github/workflows/node-ci.yml b/.github/workflows/node-ci.yml index 1d93062..2817c09 100644 --- a/.github/workflows/node-ci.yml +++ b/.github/workflows/node-ci.yml @@ -9,7 +9,7 @@ on: jobs: test-build-release: env: - IS_PUSH_TO_MASTER: true # ${{ github.event.push && github.ref == 'refs/heads/main' }} + IS_PUSH_TO_MASTER: ${{ github.event.push && github.ref == 'refs/heads/master' }} runs-on: ubuntu-latest @@ -38,6 +38,8 @@ jobs: # Steps below deal with uploading Storybook to S3, # which is only performed with a push to the main branch. + # Note that AWS CLI v2 is already installed by default on GitHub's Ubuntu 20.04. + # per https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-README.md#cli-tools. - name: Add AWS credentials if: ${{ env.IS_PUSH_TO_MASTER }} run: mkdir ~/.aws && printf '%s\n' '[default]' "aws_access_key_id=$AWS_ACCESS_KEY_ID" "aws_secret_access_key=$AWS_SECRET_ACCESS_KEY" "region=$AWS_REGION" > ~/.aws/config @@ -45,17 +47,6 @@ jobs: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_REGION: ${{ secrets.AWS_REGION }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - # Install AWS CLI v1 using pip for uploading storybook to S3 - # (AWS CLI v2 does not come with a non-sudo installer as of writing). - #- name: Set up Python (latest 3.x) - # if: ${{ env.IS_PUSH_TO_MASTER }} - # uses: actions/setup-python@v2 - #- name: Install pip - # if: ${{ env.IS_PUSH_TO_MASTER }} - # run: pip install -U pip - #- name: Install AWS CLI v1 - # if: ${{ env.IS_PUSH_TO_MASTER }} - # run: pip install awscli # Deploy storybook demo to S3 if handling a push (non-PR build) on the main branch # https://s3.amazonaws.com/transitive.js/index.html - name: Deploy storybook to S3 diff --git a/package.json b/package.json index 0195b96..5625061 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "lint": "mastarm lint lib", "semantic-release": "semantic-release", "start": "start-storybook -p 5555", - "deploy-storybook": "storybook-to-aws-s3 --bucket-path=bdam-testbuckt --s3-sync-options=--acl=public-read" + "deploy-storybook": "storybook-to-aws-s3 --bucket-path=transitive.js --s3-sync-options=--acl=public-read" }, "devDependencies": { "@babel/core": "^7.12.3", From 6f2aa1df418a4428f602298bf626d69517c8276d Mon Sep 17 00:00:00 2001 From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com> Date: Fri, 12 Mar 2021 15:52:11 -0500 Subject: [PATCH 15/20] ci(node-ci): Try without explicity installing node/npm --- .github/workflows/node-ci.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/node-ci.yml b/.github/workflows/node-ci.yml index 2817c09..9b855ac 100644 --- a/.github/workflows/node-ci.yml +++ b/.github/workflows/node-ci.yml @@ -15,12 +15,6 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Use Node.js 12.x - uses: actions/setup-node@v1 - with: - node-version: 12.x - - name: Install npm packages using cache - uses: bahmutov/npm-install@v1 - name: Lint code run: yarn lint - name: Run tests with coverage From 59006f963cbda4c412e1a3a64437bc1826a63cca Mon Sep 17 00:00:00 2001 From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com> Date: Fri, 12 Mar 2021 15:54:09 -0500 Subject: [PATCH 16/20] Revert "ci(node-ci): Try without explicity installing node/npm" This reverts commit 6f2aa1df418a4428f602298bf626d69517c8276d. --- .github/workflows/node-ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/node-ci.yml b/.github/workflows/node-ci.yml index 9b855ac..2817c09 100644 --- a/.github/workflows/node-ci.yml +++ b/.github/workflows/node-ci.yml @@ -15,6 +15,12 @@ jobs: steps: - uses: actions/checkout@v2 + - name: Use Node.js 12.x + uses: actions/setup-node@v1 + with: + node-version: 12.x + - name: Install npm packages using cache + uses: bahmutov/npm-install@v1 - name: Lint code run: yarn lint - name: Run tests with coverage From 23c867878469e18124cbca7c0b4a639adc7722a5 Mon Sep 17 00:00:00 2001 From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com> Date: Fri, 12 Mar 2021 15:56:07 -0500 Subject: [PATCH 17/20] ci(node-ci): Try without installing node explicity --- .github/workflows/node-ci.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/node-ci.yml b/.github/workflows/node-ci.yml index 2817c09..2153d4b 100644 --- a/.github/workflows/node-ci.yml +++ b/.github/workflows/node-ci.yml @@ -15,10 +15,6 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Use Node.js 12.x - uses: actions/setup-node@v1 - with: - node-version: 12.x - name: Install npm packages using cache uses: bahmutov/npm-install@v1 - name: Lint code From 944333315a5d9ce5dd14525ee5dbf022a8894112 Mon Sep 17 00:00:00 2001 From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com> Date: Fri, 12 Mar 2021 16:03:35 -0500 Subject: [PATCH 18/20] Revert "ci(node-ci): Try without installing node explicity" This reverts commit 23c867878469e18124cbca7c0b4a639adc7722a5. --- .github/workflows/node-ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/node-ci.yml b/.github/workflows/node-ci.yml index 2153d4b..2817c09 100644 --- a/.github/workflows/node-ci.yml +++ b/.github/workflows/node-ci.yml @@ -15,6 +15,10 @@ jobs: steps: - uses: actions/checkout@v2 + - name: Use Node.js 12.x + uses: actions/setup-node@v1 + with: + node-version: 12.x - name: Install npm packages using cache uses: bahmutov/npm-install@v1 - name: Lint code From ddeea28cc95b6d3798ff6a0be8c6083a6aa93d8e Mon Sep 17 00:00:00 2001 From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com> Date: Tue, 16 Mar 2021 10:55:19 -0400 Subject: [PATCH 19/20] ci(node-ci.yml): Rename GITHUB_TOKEN to GH_TOKEN --- .github/workflows/node-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node-ci.yml b/.github/workflows/node-ci.yml index 2817c09..d97606e 100644 --- a/.github/workflows/node-ci.yml +++ b/.github/workflows/node-ci.yml @@ -32,7 +32,7 @@ jobs: continue-on-error: true - name: Semantic Release env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ secrets.GH_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} run: yarn semantic-release From 23a8d3673f336433edfd615098f2b50a36f4ba4d Mon Sep 17 00:00:00 2001 From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com> Date: Thu, 25 Mar 2021 17:37:27 -0400 Subject: [PATCH 20/20] ci(node-ci.yml): Print env vars. --- .github/workflows/node-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/node-ci.yml b/.github/workflows/node-ci.yml index d97606e..3f4753b 100644 --- a/.github/workflows/node-ci.yml +++ b/.github/workflows/node-ci.yml @@ -9,6 +9,8 @@ on: jobs: test-build-release: env: + GIT_BRANCH_NAME: ${{ github.ref }} + IS_PUSH: ${{ github.event.push }} IS_PUSH_TO_MASTER: ${{ github.event.push && github.ref == 'refs/heads/master' }} runs-on: ubuntu-latest