-
Notifications
You must be signed in to change notification settings - Fork 76
65 lines (61 loc) · 2.29 KB
/
deploy-next.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
59
60
61
62
63
64
65
name: Build
concurrency:
group: deploy_next
cancel-in-progress: true
on:
workflow_dispatch:
push:
branches: [main]
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.ADMIN_TOKEN }}
ref: main
- uses: actions/setup-node@v3
with:
node-version-file: package.json
registry-url: "https://registry.npmjs.org"
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: storybook/next deployment
env:
NEXT_RELEASE_ENABLED: ${{ secrets.NEXT_RELEASE_ENABLED }}
# https://github.com/storybookjs/storybook-deployer/issues/77#issuecomment-618560481
GH_TOKEN_FOR_STORYBOOK: ${{ github.actor }}:${{ secrets.ADMIN_TOKEN }}
run: |
if [ "$NEXT_RELEASE_ENABLED" == "true" ]; then
npm install
if npm run util:is-next-deployable; then
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
# version the packages with lerna before building to ensure
# the version in the CC source code preamble is correct for deployment
npm run version:next
npm run build
npm test
# deploy storybook, but still release next if it fails
{ npm run --workspace=@esri/calcite-components build-storybook &&
npx --workspace=@esri/calcite-components storybook-to-ghpages \
--host-token-env-variable=GH_TOKEN_FOR_STORYBOOK \
--existing-output-dir=docs --ci; } || true
# remove the built docs after storybook deploys to gh-pages
git reset --hard
npm run publish:next
npm run util:push-tags
fi
else
echo "Next release is disabled"
fi
- name: notify teams
uses: toko-bifrost/ms-teams-deploy-card@3.1.2
if: always()
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
webhook-uri: ${{ secrets.TEAMS_WEBHOOK_URI_BUILD }}
show-on-start: false
card-layout-exit: complete
timezone: America/Los_Angeles