Skip to content

Commit 38d750a

Browse files
authored
Merge branch 'ep2025' into ep2025-layout-v2
2 parents 65523eb + f31a3f9 commit 38d750a

File tree

17 files changed

+1029
-69
lines changed

17 files changed

+1029
-69
lines changed

.github/workflows/preview.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ jobs:
1111
env:
1212
PREVIEW_HOSTNAME: ep-preview.click
1313
GITHUB_BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
14+
GITHUB_COMMIT_HASH: ${{ github.event.pull_request.head.sha }}
1415

1516
steps:
1617
- name: Checkout
@@ -33,15 +34,12 @@ jobs:
3334
- name: Install dependencies
3435
run: make install
3536

36-
- name: Get current branch name
37-
run: |
38-
BRANCH_NAME=$(make safe_branch BRANCH=$GITHUB_BRANCH_NAME)
39-
echo "BRANCH_NAME=${BRANCH_NAME}" >> $GITHUB_ENV
40-
4137
- name: Build the website
42-
run:
43-
make build MODE=preview
44-
SITE_URL="https://${BRANCH_NAME}.ep-preview.click"
38+
env:
39+
BRANCH: "${{ env.GITHUB_BRANCH_NAME }}"
40+
GIT_VERSION: "${{ env.GITHUB_COMMIT_HASH }}"
41+
MODE: "preview"
42+
run: make build
4543

4644
- name: Set up SSH key
4745
uses: webfactory/[email protected]
@@ -52,7 +50,9 @@ jobs:
5250
run: ssh-keyscan "static.europython.eu" > ~/.ssh/known_hosts
5351

5452
- name: Upload preview
55-
run: make preview BRANCH=$GITHUB_BRANCH_NAME
53+
env:
54+
BRANCH: "${{ env.GITHUB_BRANCH_NAME }}"
55+
run: make preview
5656

5757
- name: Update PR Comment
5858
uses: actions/github-script@v7
@@ -80,7 +80,7 @@ jobs:
8080
}
8181
});
8282
83-
const branch_name = process.env.BRANCH_NAME;
83+
const branch_name = process.env.GITHUB_BRANCH_NAME;
8484
const url = "https://" + branch_name + "." + process.env.PREVIEW_HOSTNAME;
8585
const timestamp = new Date().toISOString();
8686
const header = "\n|Key|Value|\n|---|---|\n"

astro.config.mjs

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,31 @@ import deleteUnusedImages from "astro-delete-unused-images";
1313
import preload from "astro-preload";
1414
import { execSync } from "node:child_process";
1515

16-
let gitVersion = "";
17-
try {
18-
gitVersion = execSync("git rev-parse --short HEAD 2>&1 > /dev/null");
19-
} catch (e) {}
16+
let gitVersion = String(process.env.GIT_VERSION ?? "").slice(0, 7);
17+
18+
if (!gitVersion) {
19+
try {
20+
gitVersion = execSync("git rev-parse --short HEAD", {
21+
stdio: ["ignore", "pipe", "ignore"],
22+
})
23+
.toString()
24+
.trim();
25+
} catch {
26+
gitVersion = "unknown";
27+
}
28+
}
2029

2130
// https://astro.build/config
2231
export default defineConfig({
2332
vite: {
2433
define: {
25-
"import.meta.env.TIMESTAMP": new Date()
26-
.toISOString()
27-
.replace(/[-:T.Z]/g, "")
28-
.slice(0, 14),
29-
"import.meta.env.GIT_VERSION": new String(gitVersion),
34+
__TIMESTAMP__: JSON.stringify(
35+
new Date()
36+
.toISOString()
37+
.replace(/[-:T.Z]/g, "")
38+
.slice(0, 14)
39+
),
40+
__GIT_VERSION__: JSON.stringify(gitVersion),
3041
},
3142
resolve: {
3243
alias: {

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313
"dependencies": {
1414
"@astro-community/astro-embed-youtube": "^0.5.6",
1515
"@astrojs/check": "^0.9.4",
16-
"@astrojs/mdx": "^4.2.5",
16+
"@astrojs/mdx": "^4.2.6",
1717
"@astrojs/react": "^4.2.5",
1818
"@astrojs/sitemap": "^3.3.1",
1919
"@astrojs/tailwind": "^5.1.5",
2020
"@fontsource-variable/inter": "^5.2.5",
2121
"@fortawesome/fontawesome-free": "^6.7.2",
2222
"@tailwindcss/typography": "^0.5.16",
2323
"@types/react": "^19.1.2",
24-
"@types/react-dom": "^19.1.2",
24+
"@types/react-dom": "^19.1.3",
2525
"astro": "^5.7.5",
2626
"astro-delete-unused-images": "^1.0.3",
2727
"astro-meta-tags": "^0.3.1",
@@ -47,7 +47,8 @@
4747
"@types/js-yaml": "^4.0.9",
4848
"prettier": "^3.5.3",
4949
"prettier-plugin-astro": "^0.14.1",
50-
"tsx": "^4.19.3",
50+
"tsx": "^4.19.4",
51+
"puppeteer": "^24.7.2",
5152
"typescript": "^5.8.3"
5253
},
5354
"prettier": {

0 commit comments

Comments
 (0)