11name : Website
22
3- # Builds the playground engine and the site, and checks them. It runs on pull requests that touch
4- # them and on demand, never on push to main, and it never deploys: the site is not public yet.
5- # Add a deploy job only once publishing is approved.
3+ # Builds the playground engine and the site, checks them, and deploys sqlquack.io to GitHub Pages
4+ # from main. While the repository is private, only pull requests and manual runs build, and nothing
5+ # deploys. The site goes live from the `public` event when the repository is made public, or from a
6+ # manual run on main once Pages is enabled.
67on :
8+ public :
9+ push :
10+ branches : [main]
11+ paths :
12+ - website/**
13+ - crates/sqlquack-core/**
14+ - crates/sqlquack-duckdb/**
15+ - crates/sqlquack-rules/**
16+ - crates/sqlquack-semantics/**
17+ - crates/sqlquack-snowflake/**
18+ - crates/sqlquack-syntax/**
19+ - .github/workflows/website.yml
720 pull_request :
821 paths :
922 - website/**
@@ -26,6 +39,7 @@ concurrency:
2639jobs :
2740 build :
2841 name : Build the engine and the website
42+ if : github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' || !github.event.repository.private
2943 runs-on : ubuntu-24.04
3044 defaults :
3145 run :
7690
7791 - name : Check links
7892 run : python3 scripts/check_links.py dist
93+
94+ - name : Upload site
95+ if : github.event_name != 'pull_request'
96+ uses : actions/upload-pages-artifact@v3
97+ with :
98+ path : website/dist
99+
100+ deploy :
101+ name : Deploy to GitHub Pages
102+ if : github.event_name != 'pull_request' && github.ref == 'refs/heads/main' && !github.event.repository.private
103+ needs : build
104+ runs-on : ubuntu-24.04
105+ permissions :
106+ pages : write
107+ id-token : write
108+ environment :
109+ name : github-pages
110+ url : ${{ steps.deployment.outputs.page_url }}
111+ steps :
112+ - name : Deploy
113+ id : deployment
114+ uses : actions/deploy-pages@v4
0 commit comments