Skip to content

Commit e7ccbf3

Browse files
committed
Auto-commit
1 parent dc72885 commit e7ccbf3

File tree

4 files changed

+130
-0
lines changed

4 files changed

+130
-0
lines changed

.github/workflows/website.yml

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
name: Deploy Website
2+
3+
on:
4+
push:
5+
branches: [ main, master ]
6+
paths:
7+
- 'website/**'
8+
- 'docs/**'
9+
pull_request:
10+
branches: [ main, master ]
11+
paths:
12+
- 'website/**'
13+
- 'docs/**'
14+
workflow_dispatch:
15+
16+
jobs:
17+
build-and-deploy:
18+
name: Build and Deploy Hugo Website
19+
runs-on: ubuntu-latest
20+
environment: production
21+
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'
22+
23+
steps:
24+
- name: Checkout repository
25+
uses: actions/checkout@v4
26+
with:
27+
submodules: true
28+
fetch-depth: 0
29+
30+
- name: Setup Hugo
31+
uses: peaceiris/actions-hugo@v2
32+
with:
33+
hugo-version: 'latest'
34+
extended: true
35+
36+
- name: Setup Node.js
37+
uses: actions/setup-node@v4
38+
with:
39+
node-version: '18'
40+
cache: 'npm'
41+
cache-dependency-path: 'website/package-lock.json'
42+
43+
- name: Install dependencies
44+
run: |
45+
cd website
46+
npm ci
47+
48+
- name: Build website
49+
run: |
50+
cd website
51+
hugo --minify --gc
52+
53+
- name: Deploy to GitHub Pages
54+
uses: peaceiris/actions-gh-pages@v3
55+
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'
56+
with:
57+
github_token: ${{ secrets.GITHUB_TOKEN }}
58+
publish_dir: ./website/public
59+
cname: distributed-gradle-building.com
60+
61+
preview:
62+
name: Deploy Preview
63+
runs-on: ubuntu-latest
64+
if: github.event_name == 'pull_request'
65+
66+
steps:
67+
- name: Checkout repository
68+
uses: actions/checkout@v4
69+
with:
70+
submodules: true
71+
fetch-depth: 0
72+
73+
- name: Setup Hugo
74+
uses: peaceiris/actions-hugo@v2
75+
with:
76+
hugo-version: 'latest'
77+
extended: true
78+
79+
- name: Setup Node.js
80+
uses: actions/setup-node@v4
81+
with:
82+
node-version: '18'
83+
cache: 'npm'
84+
cache-dependency-path: 'website/package-lock.json'
85+
86+
- name: Install dependencies
87+
run: |
88+
cd website
89+
npm ci
90+
91+
- name: Build website
92+
run: |
93+
cd website
94+
hugo --minify --gc --baseURL "https://distributed-gradle-building-pr-${{ github.event.number }}.surge.sh"
95+
96+
- name: Deploy to Surge.sh
97+
run: |
98+
cd website/public
99+
npx surge --domain "distributed-gradle-building-pr-${{ github.event.number }}.surge.sh" --token ${{ secrets.SURGE_TOKEN }}
100+
101+
- name: Comment PR with preview URL
102+
uses: actions/github-script@v7
103+
with:
104+
script: |
105+
github.rest.issues.createComment({
106+
issue_number: context.issue.number,
107+
owner: context.repo.owner,
108+
repo: context.repo.repo,
109+
body: '🚀 **Website Preview Ready!**\n\nPreview your changes at: https://distributed-gradle-building-pr-${{ github.event.number }}.surge.sh'
110+
})

docs/CICD.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
# CI/CD Integration Guide
22

3+
## **CI/CD Pipelines Status: ACTIVE**
4+
5+
The project's CI/CD pipelines are now **enabled and active**:
6+
7+
- **Test Pipeline** (`.github/workflows/test.yml`): ✅ **ENABLED**
8+
- Unit, integration, security, performance, and load tests
9+
- Multi-version Go testing (1.19, 1.20, 1.21)
10+
- Code coverage and SonarCloud analysis
11+
12+
- **Deploy Pipeline** (`.github/workflows/deploy.yml`): ✅ **ENABLED**
13+
- Automated Docker image building and pushing
14+
- Staging and production deployments
15+
- Multi-environment support
16+
17+
- **Website Pipeline** (`.github/workflows/website.yml`): ✅ **ENABLED**
18+
- Hugo website building and deployment to GitHub Pages
19+
- Preview deployments for pull requests
20+
21+
---
22+
323
## 🔧 Integrating Distributed Builds with CI/CD Pipelines
424

525
### Implementation Choices for CI/CD

0 commit comments

Comments
 (0)