Merge pull request #3055 from Akshat55/tag-components #409
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: Deploy | |
on: | |
# Runs on pushes targeting release branches | |
push: | |
branches: ["master", "next", "v3", "v9"] | |
# Allows us to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
permissions: | |
contents: read # for checkout | |
jobs: | |
# Single deploy job since we're just deploying | |
publish: | |
environment: | |
name: Deploy | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write # to be able to publish a GitHub release | |
issues: write # to be able to comment on released issues | |
pull-requests: write # to be able to comment on pull requests | |
id-token: write # to enable use of ODIC for npm provenance | |
steps: | |
# Checkout to branch | |
- name: Checkout | |
uses: actions/checkout@v3 | |
# Set up node to use v18 | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "18" | |
cache: "npm" | |
cache-dependency-path: "package-lock.json" | |
- name: Install packages | |
run: npm i | |
# Build CCA package | |
- name: Build package | |
run: npm run build | |
# Run Semantic release to publish package to NPM | |
- name: Publish package | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
run: npm run semantic-release | |
# Push storybook build to gh-pages branch if pushed to `master` branch | |
- name: Serve storybook | |
if: github.ref_name == 'master' | |
env: | |
GH_TOKEN: ${{ secrets.CARBON_BOT_DCO }} | |
run: ./scripts/deploy.sh | |
shell: bash |