-
Notifications
You must be signed in to change notification settings - Fork 0
142 lines (125 loc) · 3.82 KB
/
jekyll.yml
File metadata and controls
142 lines (125 loc) · 3.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# Three-stage workflow: Build → Test → Deploy
# Build: builds Jekyll site and uploads artifact
# Test: runs Playwright tests, uploads results, never fails the pipeline
# Deploy: deploys to GitHub Pages (skipped on pull requests)
name: Build, Test and Deploy Jekyll site to Pages
on:
push:
branches: ["master"]
pull_request:
branches: ["master"]
workflow_dispatch:
inputs:
update_snapshots:
description: 'Update Playwright snapshots'
required: false
default: false
type: boolean
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
# Stage 1: Build - builds the Jekyll site and uploads the pages artifact
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
id: pages
uses: actions/configure-pages@v5
- name: Build with Jekyll in devcontainer
uses: devcontainers/ci@v0.3
with:
push: never
runCmd: |
bundle install
bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
env:
JEKYLL_ENV: production
- name: Upload pages artifact
uses: actions/upload-pages-artifact@v3
# Stage 2: Test - runs Playwright tests, uploads results, never fails
test:
runs-on: ubuntu-latest
needs: build
continue-on-error: true
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build devcontainer
uses: devcontainers/ci@v0.3
with:
imageName: dotnetdevs-austria-devcontainer
cacheFrom: dotnetdevs-austria-devcontainer
push: never
runCmd: |
echo "📦 Installing dependencies..."
bundle install
npm ci
npx playwright install --with-deps chromium
- name: Run Playwright tests in devcontainer
if: ${{ !inputs.update_snapshots }}
uses: devcontainers/ci@v0.3
with:
imageName: dotnetdevs-austria-devcontainer
cacheFrom: dotnetdevs-austria-devcontainer
push: never
runCmd: |
npm run test:ci
env:
BASE_URL: http://127.0.0.1:4000
- name: Update Playwright Snapshots in devcontainer
if: ${{ inputs.update_snapshots }}
uses: devcontainers/ci@v0.3
with:
imageName: dotnetdevs-austria-devcontainer
cacheFrom: dotnetdevs-austria-devcontainer
push: never
runCmd: |
bundle exec jekyll build
npx playwright test --update-snapshots
env:
BASE_URL: http://127.0.0.1:4000
- name: Upload Playwright Report
uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 7
- name: Upload Test Results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results
path: test-results/
retention-days: 7
- name: Upload Updated Snapshots
uses: actions/upload-artifact@v4
if: ${{ inputs.update_snapshots }}
with:
name: updated-snapshots
path: |
tests/**/*.png
tests/**/*.txt
retention-days: 7
# Stage 3: Deploy - deploys to GitHub Pages (skipped on pull requests)
deploy:
runs-on: ubuntu-latest
needs: [build, test]
if: github.event_name != 'pull_request'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4