11# Combined workflow for testing and deploying Jekyll site to GitHub Pages
22# Tests must pass before deployment proceeds
3+ # Uses devcontainer for consistent environment between local dev and CI
34
45name : Test and Deploy Jekyll site to Pages
56
@@ -32,41 +33,51 @@ concurrency:
3233 cancel-in-progress : false
3334
3435jobs :
35- # Test job - runs Playwright tests on Windows (matches local dev environment)
36+ # Test job - runs Playwright tests using devcontainer for consistent environment
3637 test :
3738 timeout-minutes : 60
38- runs-on : windows -latest
39+ runs-on : ubuntu -latest
3940 steps :
4041 - name : Checkout
4142 uses : actions/checkout@v4
4243
43- - name : Setup Ruby
44- uses : ruby/setup-ruby@v1
45- with :
46- ruby-version : ' 3.1'
47- bundler-cache : true
44+ - name : Set up Docker Buildx
45+ uses : docker/setup-buildx-action@v3
4846
49- - name : Setup Node.js
50- uses : actions/setup-node@v4
47+ - name : Build devcontainer
48+ uses : devcontainers/ci@v0.3
5149 with :
52- node-version : ' 20 '
53- cache : ' npm '
54-
55- - name : Install Node dependencies
56- run : npm ci
57-
58- - name : Install Playwright Browsers
59- run : npx playwright install --with-deps chromium
60-
61- - name : Run Playwright tests
50+ imageName : dotnetdevs-austria-devcontainer
51+ cacheFrom : dotnetdevs-austria-devcontainer
52+ push : never
53+ runCmd : |
54+ echo "📦 Installing dependencies..."
55+ bundle install
56+ npm ci
57+ npx playwright install --with-deps chromium
58+
59+ - name : Run Playwright tests in devcontainer
6260 if : ${{ !inputs.update_snapshots }}
63- run : npx playwright test
61+ uses : devcontainers/ci@v0.3
62+ with :
63+ imageName : dotnetdevs-austria-devcontainer
64+ cacheFrom : dotnetdevs-austria-devcontainer
65+ push : never
66+ runCmd : |
67+ npm run test:ci
6468 env :
6569 BASE_URL : http://127.0.0.1:4000
6670
67- - name : Update Playwright Snapshots
71+ - name : Update Playwright Snapshots in devcontainer
6872 if : ${{ inputs.update_snapshots }}
69- run : npx playwright test --update-snapshots
73+ uses : devcontainers/ci@v0.3
74+ with :
75+ imageName : dotnetdevs-austria-devcontainer
76+ cacheFrom : dotnetdevs-austria-devcontainer
77+ push : never
78+ runCmd : |
79+ bundle exec jekyll build
80+ npx playwright test --update-snapshots
7081 env :
7182 BASE_URL : http://127.0.0.1:4000
7283
96107 tests/**/*.txt
97108 retention-days : 30
98109
99- # Build job - only runs after tests pass
110+ # Build job - uses devcontainer, only runs after tests pass
100111 build :
101112 runs-on : ubuntu-latest
102113 needs : test
@@ -105,18 +116,21 @@ jobs:
105116 steps :
106117 - name : Checkout
107118 uses : actions/checkout@v4
108- - name : Setup Ruby
109- uses : ruby/setup-ruby@v1
110- with :
111- ruby-version : ' 3.1'
112- bundler-cache : true
119+
113120 - name : Setup Pages
114121 id : pages
115122 uses : actions/configure-pages@v5
116- - name : Build with Jekyll
117- run : bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
123+
124+ - name : Build with Jekyll in devcontainer
125+ uses : devcontainers/ci@v0.3
126+ with :
127+ push : never
128+ runCmd : |
129+ bundle install
130+ bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
118131 env :
119132 JEKYLL_ENV : production
133+
120134 - name : Upload artifact
121135 uses : actions/upload-pages-artifact@v3
122136
0 commit comments