Skip to content

Commit

Permalink
ci: move component deployment to separate file
Browse files Browse the repository at this point in the history
  • Loading branch information
przemyslaw-bak committed Nov 15, 2023
1 parent 07b0c57 commit b9a3eb6
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/deploy-components.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Deploy components to S3
on:
workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest
environment: staging
steps:
- uses: actions/checkout@v2
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Setup Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18
- name: get-npm-version
id: package-version
uses: martinbeentjes/npm-get-version-action@v1.3.1
- name: Deploy Components
run:
aws s3 sync ./packages/components s3://${{ secrets.S3_BUCKET_COMPONENT_ITEMS }}/${{steps.package-version.outputs.current-version}} --delete
6 changes: 0 additions & 6 deletions .github/workflows/deploy-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,11 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 18
- name: get-npm-version
id: package-version
uses: martinbeentjes/npm-get-version-action@v1.3.1
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build-storybook
- name: Deploy
run: aws s3 sync ./storybook-static s3://${{ secrets.S3_BUCKET }} --delete
- name: Deploy Components
run:
aws s3 sync ./packages/components s3://${{ secrets.S3_BUCKET_COMPONENT_ITEMS }}/${{steps.package-version.outputs.current-version}} --delete
- name: Invalidate Cloudfront
run: aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION }} --paths "/*"

0 comments on commit b9a3eb6

Please sign in to comment.