Skip to content
This repository was archived by the owner on Dec 16, 2025. It is now read-only.

Commit 68e5058

Browse files
committed
Set up build-only and build-staging jobs.
Signed-off-by: Kurt Garloff <kurt@garloff.de>
1 parent 6737a23 commit 68e5058

File tree

3 files changed

+91
-1
lines changed

3 files changed

+91
-1
lines changed

.github/workflows/build_and_deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Gatsby Build and Deploy to gh-pages branch
33
on:
44
workflow_dispatch:
55
schedule:
6-
- cron: "0 0 * * *"
6+
- cron: "0 20 * * *"
77
push:
88
branches:
99
- main
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Gatsby Build and Deploy to gh-pages branch
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: "0 40 * * *"
7+
push:
8+
branches:
9+
- staging
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
# Checkout the repository
16+
- name: Checkout Repository
17+
uses: actions/checkout@v3
18+
19+
# Set up Node.js for the Gatsby build
20+
- name: Setup Node.js
21+
uses: actions/setup-node@v3
22+
with:
23+
node-version: 18
24+
25+
# Cache dependencies to speed up builds
26+
- name: Cache Node modules
27+
uses: actions/cache@v3
28+
with:
29+
path: ~/.npm
30+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
31+
restore-keys: |
32+
${{ runner.os }}-node-
33+
34+
# Install dependencies and build the Gatsby site
35+
- name: Install dependencies and build site
36+
run: |
37+
npm ci
38+
npm run build
39+
40+
# Deploy the built Gatsby site to GitHub Pages
41+
- name: Deploy
42+
uses: peaceiris/actions-gh-pages@v3
43+
with:
44+
publish_dir: ./public # Gatsby builds the site in the 'public' folder
45+
github_token: ${{ secrets.GITHUB_TOKEN }} # Verwende den PAT Token für das Deployment
46+
force_orphan: true
47+
user_name: 'github-actions[bot]'
48+
user_email: 'github-actions[bot]@users.noreply.github.com'
49+
commit_message: 'Deploy Gatsby site'
50+
publish_branch: gh-pages-staging

.github/workflows/build_only.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Gatsby Build and Deploy to gh-pages branch
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: "1 10 * * *"
7+
push:
8+
branches-ignore:
9+
- main
10+
- staging
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
steps:
16+
# Checkout the repository
17+
- name: Checkout Repository
18+
uses: actions/checkout@v3
19+
20+
# Set up Node.js for the Gatsby build
21+
- name: Setup Node.js
22+
uses: actions/setup-node@v3
23+
with:
24+
node-version: 18
25+
26+
# Cache dependencies to speed up builds
27+
- name: Cache Node modules
28+
uses: actions/cache@v3
29+
with:
30+
path: ~/.npm
31+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
32+
restore-keys: |
33+
${{ runner.os }}-node-
34+
35+
# Install dependencies and build the Gatsby site
36+
- name: Install dependencies and build site
37+
run: |
38+
npm ci
39+
npm run build
40+

0 commit comments

Comments
 (0)