File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Deploy to GCP
2+
3+ on :
4+ push :
5+ branches : [main]
6+ workflow_dispatch :
7+
8+ jobs :
9+ deploy :
10+ runs-on : ubuntu-latest
11+ steps :
12+ - name : Pull and optionally restart
13+ uses : appleboy/ssh-action@v1.2.0
14+ with :
15+ host : ${{ secrets.SERVER_HOST }}
16+ username : ${{ secrets.SERVER_USER }}
17+ key : ${{ secrets.SERVER_SSH_KEY }}
18+ script : |
19+ cd /opt/boost
20+ git fetch origin main
21+ CHANGED=$(git diff HEAD origin/main --name-only)
22+ git pull origin main
23+ if echo "$CHANGED" | grep -qE "^(Dockerfile|nginx\.conf|docker-compose\.yml)$"; then
24+ docker compose up -d --build
25+ fi
Original file line number Diff line number Diff line change 1+ name : Deploy GitHub Pages (redirect only)
2+
3+ on :
4+ push :
5+ branches : [main]
6+ paths :
7+ - ' index.html'
8+ - ' 404.html'
9+ workflow_dispatch :
10+
11+ permissions :
12+ contents : read
13+ pages : write
14+ id-token : write
15+
16+ concurrency :
17+ group : pages
18+ cancel-in-progress : true
19+
20+ jobs :
21+ deploy :
22+ environment :
23+ name : github-pages
24+ url : ${{ steps.deployment.outputs.page_url }}
25+ runs-on : ubuntu-latest
26+ steps :
27+ - name : Checkout
28+ uses : actions/checkout@v4
29+
30+ - name : Prepare redirect-only artifact
31+ run : |
32+ mkdir _pages
33+ cp index.html _pages/
34+ cp 404.html _pages/
35+
36+ - name : Setup Pages
37+ uses : actions/configure-pages@v5
38+
39+ - name : Upload Pages artifact
40+ uses : actions/upload-pages-artifact@v3
41+ with :
42+ path : _pages
43+
44+ - name : Deploy to GitHub Pages
45+ id : deployment
46+ uses : actions/deploy-pages@v4
Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>
2+ < html lang ="en ">
3+ < head >
4+ < meta charset ="utf-8 ">
5+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
6+ < title > Redirecting...</ title >
7+ < script >
8+ window . location . replace (
9+ 'https://dev.cppdigest.org/boost' + window . location . pathname
10+ ) ;
11+ </ script >
12+ </ head >
13+ < body >
14+ < p > Redirecting to < a href ="https://dev.cppdigest.org/boost/ "> dev.cppdigest.org/boost/</ a > …</ p >
15+ </ body >
16+ </ html >
Original file line number Diff line number Diff line change 1+ FROM nginx:alpine
2+ COPY nginx.conf /etc/nginx/conf.d/default.conf
Original file line number Diff line number Diff line change 1+ services :
2+ boost-site :
3+ build : .
4+ container_name : boost-site
5+ ports :
6+ - " 9102:80"
7+ volumes :
8+ - /opt/boost:/usr/share/nginx/html:ro
9+ restart : unless-stopped
Original file line number Diff line number Diff line change 44 < meta charset ="UTF-8 ">
55 < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
66 < title > Boost Library Usage Analysis</ title >
7+ < script >
8+ if ( window . location . hostname === 'cppdigest.github.io' ) {
9+ window . location . replace ( 'https://dev.cppdigest.org/boost/' ) ;
10+ }
11+ </ script >
712 < style >
813 * {
914 margin : 0 ;
Original file line number Diff line number Diff line change 1+ server {
2+ listen 80 ;
3+ server_name _;
4+ root /usr/share/nginx/html;
5+ index index .html;
6+
7+ location / {
8+ try_files $uri $uri / =404 ;
9+ }
10+ }
You can’t perform that action at this time.
0 commit comments