Skip to content

Commit 233bcb6

Browse files
committed
Remove the redundant broken gh-pages deploy job
The repo has two workflows publishing to the same gh-pages branch: main-docs.yml JamesIves/github-pages-deploy-action + the automatic GITHUB_TOKEN -> works documentation.yml webfactory/ssh-agent + secrets.GH_PAGES_DEPLOY -> fails The second has been failing on every push to main with git@github.com: Permission denied (publickey) because the GH_PAGES_DEPLOY key is no longer valid. It has gone unnoticed because the site does still deploy - the other workflow does it, and needs no configured secret. Rather than rotate the key and end up with two workflows racing to publish the same content, this deletes the gh-release job. documentation.yml becomes PR validation only; main-docs.yml remains the single deploy path. GH_PAGES_DEPLOY is now referenced nowhere and the repo secret can be deleted. This also removes a hardcoded git identity pointing at a former contributor's personal email address. Other fixes while in these files: - main-docs.yml triggered on "push" with no branch filter, and its Deploy step had no condition, so a push of any branch to this repo would publish that branch's docs over the live site. Now scoped to main. - Dropped its unused "python-version: [3.6]" matrix. The job only runs yarn and npm; the value did nothing but label the check "(3.6)". - Pinned Node 20 explicitly in both workflows. Docusaurus 3 requires >= 20 and main-docs.yml was relying on the runner default, which is the same implicit dependency that left documentation.yml stuck on Node 14. - Switched main-docs.yml to "yarn install --frozen-lockfile", matching documentation.yml, so the deploy builds what the lockfile pins. - Dropped "sudo apt-get install -y yarn"; yarn is preinstalled on ubuntu-latest and the apt package is a different tool. - checkout/setup-node v1 and v2 -> v4, clearing the deprecation warnings. The deploy action itself is left at JamesIves v3 deliberately. v4 renames its inputs, and this is the only working deploy path, so it is not something to change in the same PR that touches everything around it. Verified locally on Node 20: "yarn install --frozen-lockfile" succeeds against the committed lockfile and the build produces 50 pages.
1 parent 76beaba commit 233bcb6

2 files changed

Lines changed: 23 additions & 43 deletions

File tree

Lines changed: 6 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
name: documentation
22

3+
# Validates that the docs site still builds. Deployment lives in
4+
# main-docs.yml, which publishes to gh-pages using the automatic
5+
# GITHUB_TOKEN and needs no configured secret.
36
on:
47
pull_request:
58
branches: [main]
6-
push:
7-
branches: [main]
89

910
jobs:
1011
checks:
11-
if: github.event_name != 'push'
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v1
15-
- uses: actions/setup-node@v1
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-node@v4
1616
with:
17+
# Docusaurus 3 requires Node >= 20
1718
node-version: '20.x'
1819
- name: Test Build
1920
run: |
@@ -26,30 +27,3 @@ jobs:
2627
npm i
2728
fi
2829
npm run build
29-
gh-release:
30-
if: github.event_name != 'pull_request'
31-
runs-on: ubuntu-latest
32-
steps:
33-
- uses: actions/checkout@v1
34-
- uses: actions/setup-node@v1
35-
with:
36-
node-version: '20.x'
37-
- uses: webfactory/ssh-agent@v0.5.0
38-
with:
39-
ssh-private-key: ${{ secrets.GH_PAGES_DEPLOY }}
40-
- name: Release to GitHub Pages
41-
env:
42-
USE_SSH: true
43-
GIT_USER: git
44-
run: |
45-
cd docs
46-
git config --global user.email "saifulislam84210@gmail.com"
47-
git config --global user.name "Saif Ul Islam"
48-
if [ -e yarn.lock ]; then
49-
yarn install --frozen-lockfile
50-
elif [ -e package-lock.json ]; then
51-
npm ci
52-
else
53-
npm i
54-
fi
55-
npm run deploy

.github/workflows/main-docs.yml

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,29 @@
1-
on: [push]
1+
name: deploy documentation
2+
3+
# Builds the docs site and publishes it to the gh-pages branch, which is what
4+
# GitHub Pages serves. Authenticates with the automatic GITHUB_TOKEN, so there
5+
# is no deploy key or secret to maintain.
6+
on:
7+
push:
8+
branches: [main]
29

310
jobs:
411
build_docs_job:
512
runs-on: ubuntu-latest
6-
strategy:
7-
matrix:
8-
python-version: [3.6]
913
steps:
1014
- name: Checkout
11-
uses: actions/checkout@v2
12-
- name: Dependencies
13-
run: |
14-
sudo apt-get install -y yarn
15-
id: build
15+
uses: actions/checkout@v4
16+
- name: Set up Node
17+
uses: actions/setup-node@v4
18+
with:
19+
# Docusaurus 3 requires Node >= 20. This was previously left to the
20+
# runner default, which happened to be new enough but was not pinned.
21+
node-version: '20.x'
1622
- name: Build the Website
1723
run: |
1824
cd docs
19-
yarn
20-
npm run build
25+
yarn install --frozen-lockfile
26+
npm run build
2127
- name: Deploy
2228
uses: JamesIves/github-pages-deploy-action@releases/v3
2329
with:

0 commit comments

Comments
 (0)