Skip to content

Commit 859a568

Browse files
Shelton CheungShelton Cheung
authored andcommitted
feat: add PostgreSQL chapter, site generator & deploy
Add a new 18-database chapter (18-database/main.go) demonstrating PostgreSQL usage: connection pooling, DDL, CRUD, transactions, prepared statements, JSONB, JOINs and a Repository pattern. Add a Python static site generator (scripts/build-site.py) and a GitHub Actions workflow (.github/workflows/deploy-site.yml) to build and deploy the site to GitHub Pages. Update README to include the new chapter and add github.com/lib/pq to go.mod. Also add .gitignore entries for generated site and built binaries.
1 parent f376841 commit 859a568

7 files changed

Lines changed: 1914 additions & 2 deletions

File tree

.github/workflows/deploy-site.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Deploy Go Roadmap Site
2+
3+
on:
4+
push:
5+
branches: [main, master]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: "pages"
15+
cancel-in-progress: false
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
24+
- name: Setup Python
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version: '3.x'
28+
29+
- name: Build site
30+
run: python scripts/build-site.py
31+
32+
- name: Setup Pages
33+
uses: actions/configure-pages@v5
34+
35+
- name: Upload artifact
36+
uses: actions/upload-pages-artifact@v3
37+
with:
38+
path: site
39+
40+
deploy:
41+
environment:
42+
name: github-pages
43+
url: ${{ steps.deployment.outputs.page_url }}
44+
runs-on: ubuntu-latest
45+
needs: build
46+
steps:
47+
- name: Deploy to GitHub Pages
48+
id: deployment
49+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Build output
2+
site/
3+
4+
# Go binaries
5+
01-getting-started/01-getting-started
6+
02-variables-constants/02-variables-constants
7+
03-data-types/03-data-types
8+
04-composite-types/04-composite-types
9+
05-control-flow/05-control-flow
10+
06-functions/06-functions
11+
07-pointers/07-pointers
12+
08-methods-interfaces/08-methods-interfaces
13+
09-generics/09-generics
14+
10-error-handling/10-error-handling
15+
11-modules-packages/11-modules-packages
16+
12-concurrency/12-concurrency
17+
13-standard-library/13-standard-library
18+
14-testing/14-testing
19+
15-ecosystem/15-ecosystem
20+
16-toolchain/16-toolchain
21+
17-advanced/17-advanced

0 commit comments

Comments
 (0)