forked from GSA/sam-design-system
-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (63 loc) · 1.91 KB
/
new-workflow.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
66
67
68
name: Continuous Deployment
# on:
# push:
# branches:
# - "**"
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
actions: read
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
build_matrix:
runs-on: ubuntu-latest
outputs:
json_branches: ${{ steps.generate-matrix.outputs.json_branches }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate Matrix
id: generate-matrix
run: |
branches=($(git branch -r | cut -c 3- | sed 's/origin\///g'))
json_branches=$(printf '%s\n' "${branches[@]}" | jq -R . | jq -s -c .)
echo "json_branches=${json_branches}" >> $GITHUB_OUTPUT
build:
runs-on: ubuntu-latest
name: Build
needs:
- build_matrix
strategy:
matrix:
branch: ${{ fromJSON(needs.build_matrix.outputs.json_branches) }}
steps:
- name: Check out repository code
uses: actions/checkout@v4
with:
ref: ${{ matrix.branch }}
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '16.x'
- name: Install Node Packages
run: npm i
- name: Install Global NG CLI
run: npm install -g @angular/cli@16
- name: Build Stackblitz HTMLs
run: npm run demo:stackblitzes
- name: Build Storybook Assets
env:
NODE_OPTIONS: "--max_old_space_size=4096"
run: GH_PAGES=true BRANCH=${{matrix.branch}} ng run sam-design-system-site:build-storybook
- name: Deploy 🚀
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: storybook-static
target-folder: ${{matrix.branch}}