-
Notifications
You must be signed in to change notification settings - Fork 308
58 lines (49 loc) · 1.56 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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