Skip to content

Commit 6ba4b8d

Browse files
authored
docs(static-deploy): extract github workflow file for renovate (#19863)
1 parent b5055e0 commit 6ba4b8d

File tree

3 files changed

+66
-53
lines changed

3 files changed

+66
-53
lines changed

.github/renovate.json5

+9
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,15 @@
3232
// breaking changes
3333
"kill-port", // `kill-port:^2.0.0 has perf issues (#8392)
3434
],
35+
"github-actions": {
36+
"fileMatch": [
37+
// default values
38+
"(^|/)(workflow-templates|\\.(?:github|gitea|forgejo)/(?:workflows|actions))/.+\\.ya?ml$",
39+
"(^|/)action\\.ya?ml$",
40+
// custom value
41+
"(^|/)docs/guide/static-deploy-github-pages\\.yaml$",
42+
],
43+
},
3544
"customManagers": [
3645
{
3746
"customType": "regex",
+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Imported in static-deploy.md
2+
# This file is extracted as a separate file so that renovate can update the action versions
3+
#
4+
#region content
5+
# Simple workflow for deploying static content to GitHub Pages
6+
name: Deploy static content to Pages
7+
8+
on:
9+
# Runs on pushes targeting the default branch
10+
push:
11+
branches: ['main']
12+
13+
# Allows you to run this workflow manually from the Actions tab
14+
workflow_dispatch:
15+
16+
# Sets the GITHUB_TOKEN permissions to allow deployment to GitHub Pages
17+
permissions:
18+
contents: read
19+
pages: write
20+
id-token: write
21+
22+
# Allow one concurrent deployment
23+
concurrency:
24+
group: 'pages'
25+
cancel-in-progress: true
26+
27+
jobs:
28+
# Single deploy job since we're just deploying
29+
deploy:
30+
environment:
31+
name: github-pages
32+
url: ${{ steps.deployment.outputs.page_url }}
33+
runs-on: ubuntu-latest
34+
steps:
35+
- name: Checkout
36+
uses: actions/checkout@v4
37+
- name: Set up Node
38+
uses: actions/setup-node@v4
39+
with:
40+
node-version: lts/*
41+
cache: 'npm'
42+
- name: Install dependencies
43+
run: npm ci
44+
- name: Build
45+
run: npm run build
46+
- name: Setup Pages
47+
uses: actions/configure-pages@v4
48+
- name: Upload artifact
49+
uses: actions/upload-pages-artifact@v3
50+
with:
51+
# Upload dist folder
52+
path: './dist'
53+
- name: Deploy to GitHub Pages
54+
id: deployment
55+
uses: actions/deploy-pages@v4
56+
#endregion content

docs/guide/static-deploy.md

+1-53
Original file line numberDiff line numberDiff line change
@@ -63,59 +63,7 @@ Now the `preview` command will launch the server at `http://localhost:8080`.
6363

6464
2. Go to your GitHub Pages configuration in the repository settings page and choose the source of deployment as "GitHub Actions", this will lead you to create a workflow that builds and deploys your project, a sample workflow that installs dependencies and builds using npm is provided:
6565

66-
```yml
67-
# Simple workflow for deploying static content to GitHub Pages
68-
name: Deploy static content to Pages
69-
70-
on:
71-
# Runs on pushes targeting the default branch
72-
push:
73-
branches: ['main']
74-
75-
# Allows you to run this workflow manually from the Actions tab
76-
workflow_dispatch:
77-
78-
# Sets the GITHUB_TOKEN permissions to allow deployment to GitHub Pages
79-
permissions:
80-
contents: read
81-
pages: write
82-
id-token: write
83-
84-
# Allow one concurrent deployment
85-
concurrency:
86-
group: 'pages'
87-
cancel-in-progress: true
88-
89-
jobs:
90-
# Single deploy job since we're just deploying
91-
deploy:
92-
environment:
93-
name: github-pages
94-
url: ${{ steps.deployment.outputs.page_url }}
95-
runs-on: ubuntu-latest
96-
steps:
97-
- name: Checkout
98-
uses: actions/checkout@v4
99-
- name: Set up Node
100-
uses: actions/setup-node@v4
101-
with:
102-
node-version: lts/*
103-
cache: 'npm'
104-
- name: Install dependencies
105-
run: npm ci
106-
- name: Build
107-
run: npm run build
108-
- name: Setup Pages
109-
uses: actions/configure-pages@v4
110-
- name: Upload artifact
111-
uses: actions/upload-pages-artifact@v3
112-
with:
113-
# Upload dist folder
114-
path: './dist'
115-
- name: Deploy to GitHub Pages
116-
id: deployment
117-
uses: actions/deploy-pages@v4
118-
```
66+
<<< ./static-deploy-github-pages.yaml#content
11967

12068
## GitLab Pages and GitLab CI
12169

0 commit comments

Comments
 (0)