Skip to content

Commit

Permalink
chore(CI): move Storybook deploy to publish.yml workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
dgonzalezr committed Dec 19, 2023
1 parent bb329dc commit fca9f93
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 59 deletions.
45 changes: 0 additions & 45 deletions .github/workflows/deploy.yml

This file was deleted.

28 changes: 14 additions & 14 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish NPM packages
name: NPM publish and Storybook deploy

on:
release:
Expand All @@ -8,9 +8,14 @@ env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}

permissions:
contents: read
pages: write
id-token: write

jobs:
main:
name: 📦 Publish NPM packages
name: 📦 NPM publish and 📘 Storybook deploy
runs-on: ubuntu-latest
env:
NX_BRANCH: ${{ github.head_ref || github.ref_name }}
Expand Down Expand Up @@ -42,18 +47,13 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: 🚀 Publish to NPM registry
- name: 🚀 Publish BEEQ to NPM registry
run: npx nx run-many -t publish -p tag:publishable --parallel=1 --output-style=stream-without-prefixes

- name: 🔐 Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
- name: 🚚 Deploy BEEQ Storybook to GitHub Pages
uses: bitovi/github-actions[email protected]
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{secrets.AWS_S3_BUCKET_REGION}}

- name: 🚚 Deploy to AWS S3
run: aws s3 sync dist/storybook/beeq/ s3://${{secrets.AWS_S3_BUCKET}}/ --delete --output table

- name: 🚮 Invalidate AWS CloudFront distribution cache
run: aws cloudfront create-invalidation --distribution-id ${{secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID}} --paths "/*" --output table --cli-connect-timeout 15
build_command: npm run build
checkout: false
install_command: npm ci
path: ./dist/storybook/beeq

0 comments on commit fca9f93

Please sign in to comment.