Skip to content

Commit a148ba8

Browse files
authored
docs(static-deploy): extract github workflow file for renovate (#730) (#1051)
Co-authored-by: Rush Ali <s0aPii.ra@googlemail.com> closes #730 #1051
1 parent ba654fd commit a148ba8

File tree

3 files changed

+66
-53
lines changed

3 files changed

+66
-53
lines changed

.github/renovate.json5

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,13 @@
2828
// breaking changes
2929
"kill-port", // `kill-port:^2.0.0 has perf issues (#8392)
3030
],
31+
"github-actions": {
32+
"fileMatch": [
33+
// Standardwerte
34+
"(^|/)(workflow-templates|\\.(?:github|gitea|forgejo)/(?:workflows|actions))/.+\\.ya?ml$",
35+
"(^|/)action\\.ya?ml$",
36+
// Benutzerdefinierter Wert
37+
"(^|/)docs/guide/static-deploy-github-pages\\.yaml$",
38+
],
39+
},
3140
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Importiert in static-deploy.md
2+
# Diese Datei wird als seperate Datei extrahiert, damit Renovate die Aktionsversionen aktualisieren kann
3+
#
4+
#Region Inhalt
5+
# Einfacher Arbeitsablauf zur Bereitstellung von statischem Inhalt auf GitHub Pages
6+
name: Deploy static content to Pages
7+
8+
on:
9+
# Läuft bei Pushes, die auf den Standardzweig abzielen
10+
push:
11+
branches: ['main']
12+
13+
# Ermöglicht Ihnen diesen Workflow manuell vom Aktionstab auszuführen
14+
workflow_dispatch:
15+
16+
# Setzt die GITHUB_TOKEN Berechtigung, um die Bereitstellung auf GitHub Pages zu ermöglichen
17+
permissions:
18+
contents: read
19+
pages: write
20+
id-token: write
21+
22+
# Erlaubt eine gleichzeitige Bereitstellung
23+
concurrency:
24+
group: 'pages'
25+
cancel-in-progress: true
26+
27+
jobs:
28+
# Einzelner Bereitstellungsauftrag, da wir nur bereitstellen
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+
# Ordner "dist" hochladen
52+
path: './dist'
53+
- name: Deploy to GitHub Pages
54+
id: deployment
55+
uses: actions/deploy-pages@v4
56+
#Endregion Inhalt

docs/guide/static-deploy.md

Lines changed: 1 addition & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -63,59 +63,7 @@ Jetzt startet der `preview`-Befehl den Server unter `http://localhost:8080`.
6363

6464
2. Gehen Sie zur GitHub Pages-Konfiguration in den Einstellungen des Repository und wählen Sie die Quelle für die Bereitstellung als "GitHub Actions" aus. Dadurch wird ein Workflow erstellt, der Ihr Projekt erstellt und bereitstellt. Ein Beispielworkflow, der Abhängigkeiten installiert und mit npm erstellt, ist bereitgestellt:
6565

66-
```yml
67-
# Einfacher Workflow zur Bereitstellung von statischem Inhalt auf GitHub Pages
68-
name: Statischen Inhalt auf Pages bereitstellen
69-
70-
on:
71-
# Wird bei Pushes auf den Standard-Zweig ausgeführt
72-
push:
73-
branches: ['main']
74-
75-
# Ermöglicht das manuelle Ausführen dieses Workflows über das Actions-Tab
76-
workflow_dispatch:
77-
78-
# Setzt die GITHUB_TOKEN-Berechtigungen, um die Bereitstellung auf GitHub Pages zu ermöglichen
79-
permissions:
80-
contents: read
81-
pages: write
82-
id-token: write
83-
84-
# Ermöglicht eine gleichzeitige Bereitstellung
85-
concurrency:
86-
group: 'pages'
87-
cancel-in-progress: true
88-
89-
jobs:
90-
# Einzelne Bereitstellungs-Job, da wir nur bereitstellen
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 des dist-Ordners
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 und GitLab CI
12169

0 commit comments

Comments
 (0)