Skip to content

Merge pull request #3084 from eduardmarcinco/onpush/branch-2 #429

Merge pull request #3084 from eduardmarcinco/onpush/branch-2

Merge pull request #3084 from eduardmarcinco/onpush/branch-2 #429

Workflow file for this run

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 v20
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "20"
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