Skip to content

Commit 5d9f691

Browse files
committed
changing URLs to assets
1 parent 4e5c523 commit 5d9f691

3 files changed

Lines changed: 17 additions & 4 deletions

File tree

‎.github/workflows/deploy-documents.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
# and a silent fallback indistinguishable.
6060
run: |
6161
curl -fsSL -o src/fanart.html \
62-
https://raw.githubusercontent.com/phalcon/assets/master/phalcon/fanart-fragment.html \
62+
https://assets.phalcon.io/phalcon/fanart-fragment.html \
6363
|| echo "Download failed, no fan art is rendered"
6464
6565
- name: Get the sponsors
@@ -70,7 +70,7 @@ jobs:
7070
# months out of date.
7171
run: |
7272
curl -fsSL -o src/sponsors.json \
73-
https://raw.githubusercontent.com/phalcon/assets/master/phalcon/sponsors.json \
73+
https://assets.phalcon.io/phalcon/sponsors.json \
7474
|| echo "Download failed, no sponsors are rendered"
7575
7676
- name: Build

‎scripts/sources.test.mjs‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,3 +130,16 @@ test("the deploy workflow gets the design files before the tests", () => {
130130
assert.ok(step > 0, "the step is missing");
131131
assert.ok(step < workflow.indexOf("run: pnpm test"), "the step must come before the tests");
132132
});
133+
134+
test("the deploy workflow and the refresh script read phalcon/assets from assets.phalcon.io", () => {
135+
// assets.phalcon.io is the CDN of the Phalcon sites. Cloudflare answers a
136+
// .html URL with a 308 to the URL without .html, so curl must follow it (-L).
137+
const workflow = readFileSync(new URL(".github/workflows/deploy-documents.yml", root), "utf8");
138+
const script = readFileSync(new URL("scripts/update-tokens.mjs", root), "utf8");
139+
140+
assert.doesNotMatch(workflow, /raw\.githubusercontent\.com/, "deploy-documents.yml");
141+
assert.doesNotMatch(script, /raw\.githubusercontent\.com/, "update-tokens.mjs");
142+
assert.match(script, /const SOURCE = "https:\/\/assets\.phalcon\.io\/phalcon\/css";/);
143+
assert.match(workflow, /curl -fsSL -o src\/fanart\.html \\\n\s+https:\/\/assets\.phalcon\.io\/phalcon\/fanart-fragment\.html/);
144+
assert.match(workflow, /curl -fsSL -o src\/sponsors\.json \\\n\s+https:\/\/assets\.phalcon\.io\/phalcon\/sponsors\.json/);
145+
});

‎scripts/update-tokens.mjs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* phalcon/css/code-theme.json). The deploy workflow runs it before the tests
55
* and the build. It does not commit: the committed copies are the default.
66
*
7-
* node scripts/update-tokens.mjs download the files from GitHub
7+
* node scripts/update-tokens.mjs download the files from assets.phalcon.io
88
* node scripts/update-tokens.mjs --from DIR read DIR/tokens.css and DIR/code-theme.json instead
99
*
1010
* A file that cannot be read, or that has a problem (see tokensProblems and
@@ -17,7 +17,7 @@ import { codeThemeProblems, definedCodeRoles } from "../src/lib/code-theme.mjs";
1717
import { tokensProblems } from "../src/lib/tokens.mjs";
1818
import { usedBySite } from "./token-sources.mjs";
1919

20-
const SOURCE = "https://raw.githubusercontent.com/phalcon/assets/master/phalcon/css";
20+
const SOURCE = "https://assets.phalcon.io/phalcon/css";
2121

2222
const FILES = [
2323
{

0 commit comments

Comments
 (0)