update versions to v2.43.2 #75
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
concurrency: ${{ github.workflow }} | |
on: | |
push: | |
tags: | |
- v* | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.VNG_VVD_PAT }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Setup NodeJS 14 | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 14 | |
- name: Writing .npmrc | |
run: printf "registry=https://npm.pkg.github.com/Vonage\n_authToken=\${GITHUB_TOKEN}\n//npm.pkg.github.com/:_authToken=\${GITHUB_TOKEN}\nalways-auth=true" > .npmrc | |
- name: Install dependencies | |
run: yarn install --network-timeout 100000 | |
- run: yarn compile | |
- run: tar -zcf /tmp/vivid-env.tar.gz . | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: workspace | |
path: /tmp/vivid-env.tar.gz | |
publish: | |
needs: build | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.VNG_VVD_PAT }} | |
name: Publishing to ${{ matrix.registry }} | |
strategy: | |
fail-fast: false | |
matrix: | |
registry: | |
- github | |
- npm | |
include: | |
- registry: github | |
token_secret: GITHUB_TOKEN | |
host: npm.pkg.github.com | |
- registry: npm | |
token_secret: NPM_AUTH_TOKEN | |
host: registry.npmjs.org | |
steps: | |
- uses: actions/setup-node@v2 | |
- uses: actions/download-artifact@v2 | |
with: | |
name: workspace | |
path: /tmp | |
- run: tar -zxf /tmp/vivid-env.tar.gz | |
- name: Creating ".npmrc" | |
run: printf "always-auth=true\nregistry=https://${{ matrix.host }}/\n//${{ matrix.host }}/:_authToken=${{ secrets[matrix.token_secret] }}" > .npmrc | |
- name: Publishing "@vonage/vivid" package | |
run: npm publish $(node ./scripts/vivid-all-package-generator) --tag vivid-2 | |
- name: Publishing packages | |
run: yarn lerna publish from-package --registry=https://${{ matrix.host }} --no-git-reset --loglevel verbose --yes --no-verify-access | |
deploy_storybook: | |
name: Deploy "vivid.vonage.com" (Storybook) | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_VIVID_DEMO_PROD_ACCESS }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_VIVID_DEMO_PROD_SECRET }} | |
AWS_DEFAULT_REGION: us-east-1 | |
GITHUB_TOKEN: ${{ secrets.VNG_VVD_PAT }} | |
needs: publish | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Setup NodeJS 14 | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 14 | |
- uses: actions/download-artifact@v2 | |
with: | |
name: workspace | |
path: /tmp | |
- run: tar -zxf /tmp/vivid-env.tar.gz | |
# Build and deploy showcase | |
- name: Build storybook | |
run: yarn storybook:build | |
- name: Create deploy timestamp/version | |
run: echo "STORYBOOK_DEPLOY_TIMESTAMP=$(jq -r '.timestamp' ./.storybook/static/build-details.json)" >> $GITHUB_ENV | |
- name: Deploy showcase versioned as ${{ env.STORYBOOK_DEPLOY_TIMESTAMP }} | |
run: aws s3 sync ./.out/ s3://${{ secrets.AWS_VIVID_DEMO_PROD_BUCKET }}/${{ env.STORYBOOK_DEPLOY_TIMESTAMP }} | |
- name: Update CloudFront distribution root object ${{ env.STORYBOOK_DEPLOY_TIMESTAMP }} | |
run: aws cloudfront update-distribution --id ${{ secrets.AWS_VIVID_DEMO_PROD_DISTRIBUTION }} --default-root-object ${{ env.STORYBOOK_DEPLOY_TIMESTAMP }}/index.html | |
- name: Invalidate CloudFront distribution root object's cache | |
run: aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_VIVID_DEMO_PROD_DISTRIBUTION }} --paths "/" |