generated from cloudoperators/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (41 loc) · 1.61 KB
/
deploy-github-pages.yaml
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
# Run it locally with act (https://github.com/nektos/act)
# 1. Install act:
# `brew install act`
# 2. Create a .secret file with the following content:
# `GITHUB_TOKEN=your_github_token`
# PULL REQUEST
# 1. Create a act_pull_request.json file in case of a pull request with the following content:
# `{"pull_request": {"number": <PR number>, "head": {"ref": "<PR branch name>", "sha": "PR commit sha"}, "base": {"ref": "main"}}, "repository": {"name": "juno", "owner": {"login": "cloudoperators"}}}`
# 2. Run the following command:
# `act push --container-architecture linux/amd64 -P default=catthehacker/ubuntu:act-latest -e act_push.json -W .github/workflows/deploy-github-pages.yaml`
name: Storybook to GitHub Pages
on:
push:
branches:
- main
paths:
- "packages/ui-components/**"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
permissions:
contents: write
jobs:
build-and-deploy:
concurrency: deploy-gh-pages-${{ github.ref }} # Recommended if you intend to make multiple deployments in quick succession.
runs-on: [default]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20.x"
- name: Install dependencies
run: |
npm install --force
- name: Build storybook
run: npm -w @cloudoperators/juno-ui-components run build-storybook
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: packages/ui-components/storybook-static
clean-exclude: pr-preview/
force: false