Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
fingerartur committed Nov 21, 2023
1 parent 4f6c967 commit 12f56e8
Showing 1 changed file with 13 additions and 18 deletions.
31 changes: 13 additions & 18 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ env:
NPM_TOKEN: ${{ secrets.CLPLAYERS_NPM_TOKEN_RW }}
# VERSION: ${{ github.event.release.tag_name }}
VERSION: 0.7.7
WEB_PATH: "react-dom/${{ env.VERSION }}/docs/"

permissions:
id-token: write # This is required for aws-actions/configure-aws-credentials
Expand Down Expand Up @@ -43,38 +44,32 @@ jobs:
- name: Build
run: npm run build

# TODO NOT dry run
# TODO remove the --dry-run
- name: Publish to NPM
run: npm publish --dry-run

- name: Add NPM Job summary
- name: Add NPM Release Job summary
run: |
echo '### NPM Release' >> $GITHUB_STEP_SUMMARY
echo "Released version ${{ env.VERSION }} of https://www.npmjs.com/package/@castlabs/prestoplay-react-components" >> $GITHUB_STEP_SUMMARY
- name: Build Storybook
run: npm run build-storybook

# TODO remove this debug
- name: Debug Echo target bucket
run: echo "s3://players-castlabs-com-root/react-dom/${{ env.VERSION }}/"

# # TODO how does this work? Does the repo need to be registered to be
# # able to assume that role or what?
- name: Assume AWS role
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: arn:aws:iam::068037490145:role/prestoplay-web-web-uploader
aws-region: us-east-1

# Is there a dry run? Let's perhaps try version 0.0.1
# - name: Upload to S3
# run: aws s3 cp --dryrun --recursive “./dist/storybook" "s3://players-castlabs-com-root/react-dom/${{ env.VERSION }}/"

# Let’s keep the default cache policy which is 1 day
# This will publish to https://players.castlabs.com/react-dom (I hope)
# TODO remove the --dryrun
- name: Upload to S3
run: aws s3 cp --dryrun --recursive “./dist/storybook" "s3://players-castlabs-com-root/${{ env.WEB_PATH }}"
# Note: the default cache policy is 1 day, I think that's OK for now.
# In the future if traffic increases we can increase the expiration
# as much as we want.

# - name: Job Summary
# run: |
# echo '### NPM Release' >> $GITHUB_STEP_SUMMARY
# echo "Released version ${{ env.VERSION }} of https://www.npmjs.com/package/@castlabs/prestoplay-react-components" >> $GITHUB_STEP_SUMMARY
- name: Add Docs Publish Job Summary
run: |
echo '### Docs' >> $GITHUB_STEP_SUMMARY
echo "Published docs to https://players.castlabs.com/${{ env.WEB_PATH }}" >> $GITHUB_STEP_SUMMARY

0 comments on commit 12f56e8

Please sign in to comment.