forked from bonfhir/bonfhir
-
Notifications
You must be signed in to change notification settings - Fork 0
114 lines (93 loc) · 2.88 KB
/
main.yml
File metadata and controls
114 lines (93 loc) · 2.88 KB
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: BonFHIR CI
on:
push:
branches: [main]
pull_request:
types: [opened, synchronize, reopened]
concurrency: ${{ github.workflow }}-${{ github.ref }}
env:
DO_NOT_TRACK: 1
TURBO_TELEMETRY_DISABLED: 1
jobs:
build:
if: github.event.pull_request.head.ref != 'changeset-release/main' # This should skip the build step for the Pull requests that are opened from the branch changeset-release/main.
name: Build
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Setup node.js
uses: actions/setup-node@v4
with:
node-version: "lts/*"
cache: "pnpm"
- name: Install dependencies
run: pnpm install --no-frozen-lockfile
- name: Build
env:
NODE_OPTIONS: "--max_old_space_size=4096"
run: pnpm build
- name: Check & Test
env:
NODE_OPTIONS: "--max_old_space_size=4096"
run: pnpm test-check
- name: Prevent empty changesets
run: pnpm changeset status --since=origin/main
deploy:
if: github.ref == 'refs/heads/main'
needs: [build]
name: Deploy
timeout-minutes: 30
runs-on: ubuntu-latest
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Setup node.js
uses: actions/setup-node@v4
with:
node-version: "lts/*"
cache: "pnpm"
- name: Install dependencies
run: pnpm install --no-frozen-lockfile
- name: Create Release Pull Request or Publish to npm
uses: changesets/action@v1
with:
publish: pnpm packages:publish
version: pnpm packages:version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish Storybook
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: docs/storybook/dist
repository-name: bonfhir/storybook
branch: gh-pages
clean: true
token: ${{ secrets.STORYBOOK_PUBLISH_TOKEN }}
git-config-name: gh-actions
git-config-email: actions@github.com
- name: Authenticate SSH deploy key
uses: webfactory/ssh-agent@v0.7.0
with:
ssh-private-key: ${{ secrets.GH_PAGES_DEPLOY }}
- name: Deploy website
env:
USE_SSH: true
DEPLOYMENT_BRANCH: main
run: |
git config --global user.email "actions@github.com"
git config --global user.name "gh-actions"
cd docs/website && pnpm run build && pnpm run deploy