-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Direct Netlify setup for PR preview deploys (#2307)
* Direct Netlify setup for PR preview deploys * Update netlify.toml
- Loading branch information
1 parent
8d979ef
commit 7c50fae
Showing
4 changed files
with
48 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/usr/bin/env zx | ||
import 'zx/globals'; | ||
import { config, cloneWcagActRules, commitAndPush } from './commons.mjs' | ||
|
||
await cloneWcagActRules(config); | ||
await generateProposedRulePages(config); | ||
await generateTestCases(config); | ||
// const commitMessage = (await $`git log -1 --pretty=%B`).stdout; | ||
// await commitAndPush(config, commitMessage); | ||
|
||
async function generateProposedRulePages({ tmpDir, rulesDir, glossaryDir, testAssetsDir }) { | ||
await $`node ./node_modules/act-tools/dist/cli/rule-transform.js \ | ||
--rulesDir "${rulesDir}" \ | ||
--glossaryDir "${glossaryDir}" \ | ||
--testAssetsDir "${testAssetsDir}" \ | ||
--outDir "${tmpDir}" \ | ||
--proposed | ||
`; | ||
} | ||
|
||
async function generateTestCases({ tmpDir, rulesDir, testAssetsDir }) { | ||
await $`node ./node_modules/act-tools/dist/cli/build-examples.js \ | ||
--rulesDir "${rulesDir}" \ | ||
--testAssetsDir "${testAssetsDir}" \ | ||
--outDir "${tmpDir}" \ | ||
--proposed | ||
`; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,3 +72,6 @@ yarn.lock | |
|
||
# Tmp build directory | ||
wcag-act-rules-tmp/ | ||
|
||
# Local Netlify folder | ||
.netlify |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[build] | ||
command = "npm run pr:preview && cd wcag-act-rules-tmp && git submodule update --init --remote && bundle install && bundle exec jekyll build --config '_config.yml,_config_staging.yml'" | ||
# base = "wcag-act-rules-tmp" | ||
publish = "wcag-act-rules-tmp/_site" | ||
|
||
[build.environment] | ||
RUBY_VERSION = "3.3.3" | ||
|
||
[[redirects]] | ||
from = "/" | ||
to = "/standards-guidelines/act/rules/" | ||
|
||
[[redirects]] | ||
from = "/standards-guidelines/act/rules/*" | ||
to = "/standards-guidelines/at/rules/:splat/proposed" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters