Skip to content

Commit bdb11ef

Browse files
fix
1 parent c390d6e commit bdb11ef

2 files changed

Lines changed: 25 additions & 36 deletions

File tree

.github/workflows/pages.yml

Lines changed: 23 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ on:
1212

1313
permissions:
1414
contents: read
15-
pages: write
16-
id-token: write
1715

1816
concurrency:
1917
group: pages
@@ -60,24 +58,6 @@ jobs:
6058
exit 1
6159
fi
6260
63-
- name: Setup Pages
64-
uses: actions/configure-pages@v5
65-
with:
66-
enablement: true
67-
token: ${{ secrets.DEPLOY_ACCESS_TOKEN }}
68-
69-
- name: Configure Pages custom domain
70-
env:
71-
GH_TOKEN: ${{ secrets.DEPLOY_ACCESS_TOKEN || github.token }}
72-
CUSTOM_DOMAIN: adaengine.org
73-
run: |
74-
curl --fail-with-body --location --request PUT \
75-
--header "Accept: application/vnd.github+json" \
76-
--header "Authorization: Bearer ${GH_TOKEN}" \
77-
--header "X-GitHub-Api-Version: 2026-03-10" \
78-
"https://api.github.com/repos/${GITHUB_REPOSITORY}/pages" \
79-
--data "{\"cname\":\"${CUSTOM_DOMAIN}\",\"build_type\":\"workflow\"}"
80-
8161
- name: Install dependencies
8262
run: npm ci --include=dev
8363

@@ -99,18 +79,27 @@ jobs:
9979
cp dist/index.html dist/404.html
10080
touch dist/.nojekyll
10181
102-
- name: Upload artifact
103-
uses: actions/upload-pages-artifact@v3
82+
- name: Checkout Pages repository
83+
uses: actions/checkout@v4
10484
with:
105-
path: dist
106-
107-
deploy:
108-
environment:
109-
name: github-pages
110-
url: https://adaengine.org/
111-
runs-on: ubuntu-latest
112-
needs: build
113-
steps:
114-
- name: Deploy
115-
id: deployment
116-
uses: actions/deploy-pages@v4
85+
repository: AdaEngine/adaengine.github.io
86+
token: ${{ secrets.DEPLOY_ACCESS_TOKEN }}
87+
path: pages-repo
88+
89+
- name: Publish to adaengine.github.io
90+
run: |
91+
find pages-repo -mindepth 1 -maxdepth 1 ! -name .git -exec rm -rf {} +
92+
cp -R dist/. pages-repo/
93+
printf 'adaengine.org\n' > pages-repo/CNAME
94+
95+
cd pages-repo
96+
git config user.name "github-actions[bot]"
97+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
98+
git add --all
99+
100+
if git diff --cached --quiet; then
101+
echo "No changes to publish"
102+
else
103+
git commit -m "Deploy website from ${GITHUB_REPOSITORY}@${GITHUB_SHA}"
104+
git push origin HEAD:main
105+
fi

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
The site is built with Vite and deployed to GitHub Pages through `.github/workflows/pages.yml`.
66

7-
The workflow runs on pushes to `main` or `master`, installs dependencies with `npm ci`, runs `npm run test`, builds the static bundle with `npm run build`, and publishes `dist`.
7+
The workflow runs on pushes to `main` or `master`, installs dependencies with `npm ci`, runs `npm run test`, builds the static bundle with `npm run build`, and publishes `dist` to `AdaEngine/adaengine.github.io`.
88

9-
The production site is published at `https://adaengine.org/`, so the Vite base path defaults to `/`. The workflow configures the Pages custom domain through the GitHub API because `CNAME` files are ignored for custom GitHub Actions Pages deployments. Use `VITE_BASE_PATH` only for explicit non-root preview deployments.
9+
The production site is published at `https://adaengine.org/`, so the Vite base path defaults to `/`. The `AdaEngine/adaengine.github.io` repository owns the custom domain, and this repository only builds and pushes the generated site there. Use `VITE_BASE_PATH` only for explicit non-root preview deployments.
1010

1111
## Markdown articles
1212

0 commit comments

Comments
 (0)