Skip to content

Commit 9dac4bd

Browse files
authored
feat: Deploy GH pages with screen reader experiment (#689)
Fixes #686 This updates the GH pages workflow to: - Automatically deploy with changes to both `main` and `add-screen-reader-support-experimental` (the screen reader experimental branch--see RaspberryPiFoundation/blockly#9283). - Upload the screen reader version of the playground to a new `/screenreader` subdirectory in the plugin repo's GitHub pages deployment. This will approximately double the amount of time needed for the GH pages deployment since it requires building two distinct copies of core Blockly and the plugin (tip-of-tree versions and the screen reader experimentation versions). Conveniently, this will act as a fast way to see screen reader changes since they will go live a few minutes after a change to the plugin. Unfortunately, that does not reciprocate for changes to core Blockly (where most of the screen reader changes will actually occur), so oftentimes a manual run of the workflow will be needed (which should suffice in those cases). Note that this needs to be approached in this way (building and uploading both projects for changes to either branch) since the action being used for deployment doesn't support partial deployment. See: actions/deploy-pages#349.
1 parent 10d7bba commit 9dac4bd

File tree

1 file changed

+46
-12
lines changed

1 file changed

+46
-12
lines changed

.github/workflows/pages.yml

Lines changed: 46 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@
22
name: Deploy static content to Pages
33

44
on:
5-
# Runs on pushes targeting the default branch
5+
# Runs on pushes targeting the default and experimentation branches.
66
push:
7-
branches: ['main']
7+
branches:
8+
- main
9+
- add-screen-reader-support-experimental
810

9-
# Allows you to run this workflow manually from the Actions tab
11+
# Allows the workflow to be manually run from the Actions tab.
1012
workflow_dispatch:
1113

12-
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
14+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages.
1315
permissions:
1416
contents: read
1517
pages: write
@@ -26,45 +28,77 @@ jobs:
2628
build:
2729
runs-on: ubuntu-latest
2830
steps:
29-
- name: Checkout blockly
31+
- name: Checkout tip-of-tree core Blockly
3032
uses: actions/checkout@v4
3133
with:
3234
path: blockly
3335
repository: google/blockly
3436
ref: develop
3537

36-
- name: Checkout blockly-keyboard-experimentation
38+
- name: Checkout add-screen-reader-support-experimental core Blockly
39+
uses: actions/checkout@v4
40+
with:
41+
path: blockly-add-screen-reader-support-experimental
42+
repository: google/blockly
43+
ref: add-screen-reader-support-experimental
44+
45+
- name: Checkout tip-of-tree blockly-keyboard-experimentation
3746
uses: actions/checkout@v4
3847
with:
3948
path: blockly-keyboard-experimentation
4049

50+
- name: Checkout add-screen-reader-support-experimental blockly-keyboard-experimentation
51+
uses: actions/checkout@v4
52+
with:
53+
path: blockly-keyboard-experimentation-add-screen-reader-support-experimental
54+
ref: add-screen-reader-support-experimental
55+
4156
- name: Setup Node
4257
uses: actions/setup-node@v4
4358
with:
4459
node-version: 20.x
4560

46-
- name: Build blockly
61+
- name: Build tip-of-tree core Blockly
4762
run: |
4863
cd blockly
4964
npm ci
5065
npm run package
5166
cd dist
5267
npm link
53-
cd ../..
5468
55-
- name: Build blockly-keyboard-experimentation
69+
- name: Build tip-of-tree blockly-keyboard-experimentation
5670
run: |
5771
cd blockly-keyboard-experimentation
5872
npm ci
5973
npm link blockly
6074
npm run ghpages
61-
cd ..
75+
mkdir ../ghpages
76+
cp -r build/* ../ghpages/
77+
78+
- name: Build add-screen-reader-support-experimental core Blockly
79+
run: |
80+
cd blockly/dist
81+
npm unlink -g
82+
cd ../../blockly-add-screen-reader-support-experimental
83+
npm ci
84+
npm run package
85+
cd dist
86+
npm link
87+
88+
- name: Build add-screen-reader-support-experimental blockly-keyboard-experimentation
89+
run: |
90+
cd blockly-keyboard-experimentation-add-screen-reader-support-experimental
91+
npm ci
92+
npm link blockly
93+
npm run ghpages
94+
mkdir ../ghpages/screenreader
95+
cp -r build/* ../ghpages/screenreader/
6296
6397
- name: Upload artifact
6498
uses: actions/upload-pages-artifact@v3
6599
with:
66-
# Upload build folder
67-
path: './blockly-keyboard-experimentation/build'
100+
# Upload configured GH pages site files.
101+
path: './ghpages'
68102

69103
deploy:
70104
environment:

0 commit comments

Comments
 (0)