Skip to content

Commit ab43436

Browse files
committed
Separated the build and deploy steps to avoid accidental commits to the w3c repo
1 parent 38548c8 commit ab43436

4 files changed

Lines changed: 11 additions & 4 deletions

File tree

.github/scripts/push-wai.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env zx
2+
import 'zx/globals'
3+
import { config, commitAndPush } from './commons.mjs'
4+
5+
const commitMessage = (await $`git log -1 --pretty=%B`).stdout
6+
await commitAndPush(config, commitMessage)

.github/scripts/wai-build.mjs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
#!/usr/bin/env zx
22
import 'zx/globals';
3-
import { config, cloneWcagActRules, commitAndPush } from './commons.mjs'
3+
import { config, cloneWcagActRules } from './commons.mjs'
44

55
const ACT_TOOLS_PATH = process.env.ACT_TOOLS_PATH || './node_modules/act-tools';
66

77
await cloneWcagActRules(config);
88
await generateProposedRulePages(config);
99
await generateexamples(config);
1010
await generateGlossaryPage({ ...config, wcagActRulesDir: config.tmpDir });
11-
const commitMessage = (await $`git log -1 --pretty=%B`).stdout;
12-
await commitAndPush(config, commitMessage);
1311

1412
async function generateGlossaryPage({ tmpDir, rulesDir, glossaryDir, testAssetsDir }) {
1513
await $`node ${ACT_TOOLS_PATH}/dist/cli/generate-glossary.js \

.github/workflows/wai-deploy.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,7 @@ jobs:
3131
git config --global url."https://${{ secrets.WAI_GIT_NAME }}:${{ secrets.WAI_GIT_ACCESS_TOKEN }}@github.com".insteadOf "https://github.com"
3232
git config --global user.name "${{ secrets.WAI_GIT_NAME }}"
3333
git config --global user.email "${{ secrets.WAI_GIT_EMAIL }}"
34-
- name: Build and deploy WAI update
34+
- name: Build WAI update
3535
run: npm run build:wai
36+
- name: Push WAI update
37+
run: npm run push:wai

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@
178178
"format": "prettier --write *.{json,md,js,html,css,yml} './{__tests__,_rules,.github,pages,test-assets,test-utils,utils}/**/*.{json,md,js,html,css,yml}'",
179179
"test": "jest --coverage",
180180
"build:wai": "zx .github/scripts/wai-build.mjs",
181+
"push:wai": "zx .github/scripts/wai-push.mjs",
181182
"pr:preview": "zx .github/scripts/pr-preview.mjs"
182183
},
183184
"homepage": "https://github.com/act-rules/act-rules.github.io",

0 commit comments

Comments
 (0)