Skip to content

Commit

Permalink
ci(node-ci.yml): Revert S3 deploy condition to push to master.
Browse files Browse the repository at this point in the history
  • Loading branch information
binh-dam-ibigroup committed Mar 12, 2021
1 parent 2a826d6 commit 68ed8c0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
15 changes: 3 additions & 12 deletions .github/workflows/node-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -38,24 +38,15 @@ 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
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 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
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 68ed8c0

Please sign in to comment.