Skip to content

Commit 04ef778

Browse files
authored
ci: update deploy workflows (#12647) [ci skip]
1 parent 2c875c3 commit 04ef778

File tree

6 files changed

+115
-151
lines changed

6 files changed

+115
-151
lines changed

.github/workflows/deploy-website-preview-netlify.yaml renamed to .github/workflows/deploy-preview.yaml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Deploy Website Preview (Netlify)
1+
name: Deploy Website Preview
22

33
on:
44
pull_request:
@@ -40,7 +40,7 @@ jobs:
4040
node-version: 22
4141
cache: 'yarn'
4242

43-
- name: Install dependencies
43+
- name: Install
4444
run: |
4545
export NODE_OPTIONS="--max_old_space_size=4096"
4646
yarn install
@@ -53,15 +53,15 @@ jobs:
5353
echo "Branch: ${{ github.head_ref }}" >> packages/website/static/version.md
5454
echo "Commit: $(git rev-parse HEAD)" >> packages/website/static/version.md
5555
56-
- name: Build website
56+
- name: Build
5757
env:
5858
DEPLOYMENT_TYPE: "netlify_preview"
5959
DEPLOYMENT_NETLIFY_PREVIEW_BASE_URL: "https://pr-${{ github.event.number }}--ui5-webcomponents-preview.netlify.app"
6060
PR_NUMBER: "${{ github.event.number }}"
6161
run: |
6262
yarn ci:deploy:preview
6363
64-
- name: Check PR status before deployment
64+
- name: Check PR status
6565
id: final-pr-check
6666
if: always()
6767
uses: actions/github-script@v7
@@ -101,7 +101,7 @@ jobs:
101101
Cache-Control = "public, max-age=31536000, immutable"
102102
EOF
103103
104-
- name: Deploy to Netlify
104+
- name: Deploy
105105
if: steps.final-pr-check.outputs.should_deploy == 'true'
106106
uses: nwtgck/[email protected]
107107
with:
@@ -117,8 +117,3 @@ jobs:
117117
env:
118118
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
119119
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
120-
121-
- name: Skip deployment notification
122-
if: steps.final-pr-check.outputs.should_deploy == 'false'
123-
run: |
124-
echo "::notice::Skipping deployment - PR #${{ github.event.number }} was closed during build"

.github/workflows/deploy-website-auto.yaml

Lines changed: 0 additions & 45 deletions
This file was deleted.

.github/workflows/deploy-website-manually.yaml

Lines changed: 0 additions & 44 deletions
This file was deleted.

.github/workflows/deploy-website-on-release.yaml

Lines changed: 0 additions & 48 deletions
This file was deleted.

.github/workflows/deploy.yaml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: Deploy Website
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
deploy_type:
7+
description: 'deploy type'
8+
required: true
9+
type: choice
10+
options:
11+
- 'nightly'
12+
- 'latest'
13+
default: 'nightly'
14+
15+
jobs:
16+
deploy-nightly:
17+
if: ${{ github.event.inputs.deploy_type == 'nightly' }}
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
- uses: actions/[email protected]
22+
with:
23+
node-version: 22
24+
cache: 'yarn'
25+
26+
- name: Install
27+
run: |
28+
export NODE_OPTIONS="--max_old_space_size=4096"
29+
yarn install
30+
31+
- name: Update version.md
32+
run: |
33+
touch packages/website/static/version.md
34+
git log -1 &>> packages/website/static/version.md
35+
36+
- name: Build
37+
env:
38+
DEPLOYMENT_TYPE: "nightly"
39+
run: |
40+
yarn ci:deploy:nightly
41+
42+
- name: Deploy
43+
uses: JamesIves/[email protected]
44+
with:
45+
branch: gh-pages # The branch the action should deploy to.
46+
folder: packages/website/build # The folder the action should deploy.
47+
target-folder: nightly
48+
clean: true
49+
50+
deploy-latest:
51+
runs-on: ubuntu-latest
52+
if: ${{ github.event.inputs.deploy_type == 'latest' }}
53+
steps:
54+
- uses: actions/checkout@v4
55+
- uses: actions/[email protected]
56+
with:
57+
node-version: 22
58+
cache: 'yarn'
59+
60+
- name: Install
61+
run: |
62+
export NODE_OPTIONS="--max_old_space_size=4096"
63+
yarn install
64+
65+
- name: Update version.md
66+
run: |
67+
touch packages/website/static/version.md
68+
git log -1 &>> packages/website/static/version.md
69+
70+
- name: Build
71+
env:
72+
DEPLOYMENT_TYPE: "latest"
73+
run: |
74+
yarn ci:deploy
75+
76+
- name: Deploy
77+
uses: JamesIves/[email protected]
78+
with:
79+
branch: gh-pages # The branch the action should deploy to.
80+
folder: packages/website/build # The folder the action should deploy.
81+
clean: true
82+
clean-exclude: |
83+
nightly
84+
storybook
85+
playground
86+
v1
87+
googlea519d963aa8f580f.html

.github/workflows/release.yaml

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
- name: Build
6767
run: yarn ci:releasebuild
6868

69-
- name: Publish to NPM
69+
- name: Publish
7070
run: |
7171
yarn lerna publish from-git --yes
7272
@@ -91,6 +91,23 @@ jobs:
9191
const commentOnFixedIssues = (await import('${{ github.workspace }}/.github/actions/commentOnFixedIssues.mjs')).default;
9292
await commentOnFixedIssues({ github, context });
9393
94+
- name: Pre-Deploy
95+
env:
96+
DEPLOYMENT_TYPE: "latest"
97+
run: |
98+
yarn ci:deploy
99+
100+
- name: Deploy
101+
uses: JamesIves/[email protected]
102+
with:
103+
branch: gh-pages # The branch the action should deploy to.
104+
folder: packages/website/build # The folder the action should deploy.
105+
clean: true
106+
clean-exclude: |
107+
nightly
108+
v1
109+
googlea519d963aa8f580f.html
110+
94111
# ✅ Job 2: RC Release Flow
95112
rc-release:
96113
if: ${{ github.event.inputs.release_type == 'rc' || github.event_name == 'schedule' }}
@@ -128,7 +145,7 @@ jobs:
128145
- name: Build
129146
run: yarn ci:releasebuild
130147

131-
- name: Publish to NPM
148+
- name: Publish
132149
run: |
133150
yarn lerna publish from-git --yes
134151
@@ -155,6 +172,7 @@ jobs:
155172
const commentOnFixedIssues = (await import('${{ github.workspace }}/.github/actions/commentOnFixedIssues.mjs')).default;
156173
await commentOnFixedIssues({ github, context });
157174
175+
158176
# ✅ Job 3: Hotfix Release Flow
159177
hotfix-release:
160178
if: ${{ github.event.inputs.release_type == 'hotfix' }}
@@ -191,9 +209,10 @@ jobs:
191209
- name: Build
192210
run: yarn ci:releasebuild
193211

194-
- name: Publish to NPM
212+
- name: Publish
195213
run: yarn lerna publish from-git --yes --dist-tag ${{ github.event.inputs.npm_tag || 'sf' }}
196214

215+
197216
# ✅ Job 4: Experimental Release Flow
198217
experimental-release:
199218
if: ${{ github.event.inputs.release_type == 'experimental' }}
@@ -236,6 +255,6 @@ jobs:
236255
- name: Build
237256
run: yarn ci:releasebuild
238257

239-
- name: Publish to NPM
258+
- name: Publish
240259
run: |
241260
yarn lerna publish from-git --yes --dist-tag experimental

0 commit comments

Comments
 (0)