Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate git-scm.com to a static site, generated via Hugo, served via GitHub Pages #1804

Merged
merged 245 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
245 commits
Select commit Hold shift + click to select a range
170bd5d
Drop the Travis CI configuration
spraints Feb 2, 2017
7547af6
Move the favicon to the `static/` directory
spraints Feb 2, 2017
6bdd165
Drop the robots.txt file
spraints Feb 2, 2017
e4a81c2
Add a Hugo-aware .gitignore file
dscho Oct 6, 2022
88a8657
Hugo'ify the 404 page
vdye Oct 20, 2022
f212722
Adjust the Gemfile in preparation for generating a static site
dscho Apr 16, 2023
36c99e8
Drop the custom pages for HTML codes 422 and 500
dscho Apr 3, 2023
cc7c7b8
Add a Hugo configuration
spraints Feb 2, 2017
f4e8031
In preparation for using Hugo, move the "blog has moved" page
spraints Feb 2, 2017
9e27e71
ci: switch to building with Hugo
dscho Apr 1, 2023
0ea094c
Move stylesheets to `assets/sass/`
spraints Feb 2, 2017
f51c2ba
Drop the Ruby app
spraints Feb 2, 2017
990e805
Hugo-ify the "blog has moved" page
spraints Feb 2, 2017
85453c3
README: reflect that this is now a Hugo site
dscho Apr 1, 2023
890d8ba
Move the images to `static/images/`
spraints Feb 2, 2017
badd486
Move Javascripts to the `static/` directory
spraints Feb 2, 2017
ef1aae0
Remove the layout for the error pages
spraints Feb 2, 2017
5235ef7
Move the main index.html to the `content/` directory
spraints Feb 2, 2017
c4c2f3c
Allow redirecting from `list` pages
dscho Oct 5, 2023
b21af77
Migrate the primary layout to the Hugo world
spraints Feb 2, 2017
598ae29
Migrate the top-level page of the site to Hugo
dscho Oct 15, 2023
c188036
Define and use sections in a flexible way
dscho Oct 5, 2023
146998e
Adjust the layouts
spraints Feb 2, 2017
7f62106
CSS: quote URLs consistently
dscho Oct 5, 2022
2ccb905
Move the "About" pages to `content/about/`
spraints Feb 2, 2017
38227ad
Remove some includable bits that won't be needed in the future
spraints Feb 2, 2017
70841e3
Explicitly include 'normalize' in application CSS
vdye Oct 19, 2022
3848dfc
Convert 'About' pages to Hugo
spraints Feb 2, 2017
134c556
Move some includable bits to `layouts/`
dscho Apr 16, 2023
3a26b6a
Use the base URL in partial .scss files
dscho Oct 5, 2022
b506f06
about/trademark: add back old redirect
rimrul Oct 20, 2023
ff982fe
Adjust the GUI clients link in the sidebar
dscho Oct 15, 2023
4623980
Make Javascript imports explicit
dscho Oct 15, 2023
708e8d4
Add a script to update the latest Git version
dscho Oct 5, 2022
4374cec
Install redirects for two `About` pages
dscho Apr 4, 2023
b4cf11f
Migrate the community page from the web app to the static site
spraints Feb 2, 2017
43cb0da
Move the GUI Clients page into the location expected by Hugo
dscho Oct 15, 2023
e510b7a
Inline the taglines on the top
dscho Oct 15, 2023
445b418
update-git-version: skip -rc versions
dscho Aug 16, 2023
6f727ad
Remove dynamic About navigation code
spraints Feb 2, 2017
02492e2
Adjust the community page
spraints Feb 2, 2017
6619da9
Adapt the GUI Clients page to Hugo
vdye Oct 19, 2022
616848d
Drop the Rails version of the ProGit book
spraints Feb 2, 2017
29c4be3
Move the ProGit book related Ruby code to a new location
dscho Apr 9, 2023
43954f9
Transmogrify the Rake script to generate the Pro Git book sections
dscho Oct 15, 2023
1534998
docs: prepare for `index.rake` to become a proper Ruby script
vdye Oct 21, 2022
2402462
update-book2: adjust navigation
dscho Apr 11, 2023
b2f4108
Turn what used to be the `index.rake` file into a proper Ruby script
vdye Oct 21, 2022
7dca4e6
update-book2: also include the images
dscho Apr 11, 2023
096c60d
Highlight the `Reference` nav item for manual pages
dscho Oct 14, 2023
c093822
update-book2: show the chapter/section numbers in the titles
dscho Apr 11, 2023
9351e6e
update-docs: install redirects for the various versions
dscho Apr 22, 2023
cbe219d
Generate the front page of the Pro Git book
dscho Apr 11, 2023
c7cbcfb
Show the different versions of the manual pages
dscho Apr 22, 2023
8ba65b6
book: also generate the URLs for the downloadable formats of the book
dscho May 21, 2023
5e7c06b
search: exclude older manual page versions
dscho Oct 6, 2023
118f14a
update-book2.rb: gracefully warn about missing files, but continue
dscho Aug 14, 2024
e052c92
search: offer the section as a filter
dscho Oct 6, 2023
4e80209
Record SHA of the Pro Git book even when generating it locally
dscho Apr 11, 2023
dbfaf3d
search: give the manual pages' titles maximal weight
dscho Nov 7, 2023
78a3a8e
Move the search results page
dscho Apr 16, 2023
a3be5aa
Pro Git book: populate the `Chapters` drop-down
dscho Apr 11, 2023
e95c7c9
search: give the manual pages' titles maximal weight
dscho Sep 20, 2024
273ef00
Create base Downloads page
dscho Oct 15, 2023
437b0e5
Implement client-side search using Pagefind
dscho Apr 4, 2023
8abee48
book: keep colons and other special characters in URLs
dscho Aug 27, 2023
f5172ce
search: reintroduce the categories in the live search
dscho Nov 7, 2023
651de52
Move the OS-specific Downloads pages into the location needed for Hugo
dscho Oct 20, 2022
a3e140c
Implement "live search" using Pagefind
dscho Apr 4, 2023
75c2709
book: fix translated labels
dscho Aug 27, 2023
ba045fd
search: show manual pages' short title in the live search
dscho Nov 7, 2023
5ceb024
Implement the `site-param` shortcode
dscho Oct 14, 2023
6d40ec5
Mark pages with the correct language
dscho Oct 6, 2023
d4584d4
book: generate cross-references correctly
dscho Nov 17, 2023
a91f60b
search: link to "pretty" URLs
dscho Sep 10, 2024
3741988
Hugo-ify Linux & Mac download pages
vdye Oct 20, 2022
4067bd1
Direct Pagefind what parts of the pages to index
dscho Oct 14, 2023
b0cc3a9
book-tl: work around an incorrect image reference
dscho Nov 19, 2023
ba26e0b
docs: handle multiple `linkgit:` in the same line
dscho Nov 19, 2023
129b879
Add a script to store download data in `hugo.yml`
dscho Oct 20, 2022
d03a327
Live search: only load 10 results at a time
dscho Oct 9, 2023
415636d
book: work around lagging translations' image paths
dscho Nov 19, 2023
98feb15
docs: correctly handle `{litdd}` in `linkgit` values
dscho Nov 19, 2023
f3accf4
Downloads (MacOS): show relative date
dscho Oct 20, 2022
bd0f43e
Respect the language in non-live search
dscho Oct 9, 2023
18e40f2
Implement the `relurl` shortcode
dscho Oct 14, 2023
14bc87a
book(xrefs): maintain question marks that are part of the URL path
dscho Nov 20, 2023
c0b851a
docs: handle `gitlink:` gracfully
dscho Nov 19, 2023
993c1cd
Convert the Windows downloads page to Hugo
dscho Oct 20, 2022
c170058
Move the "references" landing page to `layouts/partials/`, in
dscho Oct 15, 2023
8caabdf
Use Pagefind's UI for the full search
dscho Oct 9, 2023
c923e20
Use relative URLs
dscho Oct 5, 2022
c15bf73
book: redirect missing xrefs to the English book
dscho Nov 20, 2023
bd640a1
docs: handle double colon in `linkgit::` gracefully
dscho Nov 19, 2023
50ff310
Move logos page to the new location
dscho Oct 15, 2023
b8be2ce
download(win): white-space fix
dscho Oct 15, 2023
5722d44
Move the documentation landing page in place for Hugo
dscho Oct 15, 2023
cea0c60
Move the files defining the documentation categories
dscho Oct 15, 2023
27a679b
Migrate 'Videos' page
vdye Oct 20, 2022
3fe6b82
Migrate the 'About this site' page to Hugo
vdye Oct 20, 2022
b934d2f
Add a helper script to run Pagefind
dscho Apr 25, 2024
a0ad261
Accommodate for base URLs other than `/`
dscho Apr 4, 2023
d02f153
book: handle footnotes gracefully
dscho Nov 21, 2023
b12a5d7
docs: handle `linkgit:curl[1]` gracefully
dscho Nov 19, 2023
e44ccf9
downloads/guis: adjust the Javascript for filtering
dscho Oct 6, 2023
6445fad
Migrate logos page
vdye Oct 19, 2022
7a7cb6c
Add 'Downloads' page aliases
vdye Oct 20, 2022
cc7a35f
Migrate the 'Documentation' landing page to Hugo
vdye Oct 20, 2022
94dd4cd
Adjust the "references" page to Hugo
vdye Oct 20, 2022
db1650f
Migrate individual video pages
vdye Oct 20, 2022
450b6bb
Migrate external links page to Hugo
vdye Oct 20, 2022
e2dde99
Migrate the Software Freedom Conservancy page
vdye Oct 20, 2022
5bee54b
Hugo'ify the "credential helpers" page
dscho Jul 22, 2023
286bb1d
ci: verify the order of the search results
dscho Jul 3, 2024
1ddfb14
ci: ensure that there are only relative URLs
dscho Nov 7, 2023
c058546
book: fix a couple of broken redirects
dscho Nov 21, 2023
8378b88
ci: update the books via a GitHub workflow
dscho Jul 22, 2023
614e7f9
Update the download data via a GitHub workflow
dscho Oct 7, 2023
d8dfcec
update-book: allow force-rebuilding
dscho Oct 11, 2023
9d9fe75
Add a workflow to update the Git version and manual pages
dscho Oct 9, 2023
ec5b393
update-manual-pages: optionally force a complete rebuild
dscho Oct 10, 2023
f1dcee8
Migrate the translated manual pages to the Hugo world
dscho Oct 15, 2023
0920fb1
Add a GitHub workflow to deploy `gh-pages` to GitHub Pages
dscho Oct 10, 2023
080c8f9
Merge branch 'start-migrating-to-hugo'
dscho Aug 27, 2023
22b45b0
Allow `redirect_to` with fully-qualified URLs
dscho Nov 20, 2023
6e69b7f
docs(zh_HANS-CN): a trailing "full stop" character is not part of a URL
dscho Nov 19, 2023
5bf844c
Add a GitHub workflow to update the translated manual pages regularly
dscho Oct 11, 2023
b50c2e5
Merge branch 'migrate-blog-to-hugo'
dscho Aug 27, 2023
2b6bd2a
docs: add fall-back redirects for unrendered pages
dscho Nov 20, 2023
fad0cee
redirect_to/aliases: keep the anchor, if any was specified
dscho Nov 19, 2023
9a9dc94
deploy: check for broken links
dscho Jun 21, 2024
81985c0
Merge branch 'migrate-essential-to-hugo'
dscho Aug 27, 2023
840cc25
docs: work around `link:`/`linkgit:` bugs in older versions
dscho Nov 20, 2023
c8657dc
docs(translated): add redirects for missing files
dscho Nov 19, 2023
3a03504
deploy(linkcheck): deal with stray "secondary rate limits"
dscho Sep 11, 2024
29c426c
Adjust `ARCHITECTURE.md` to the Hugo reality
dscho Apr 3, 2023
bc4b004
Merge branch 'migrate-ground-work-to-hugo'
dscho Aug 27, 2023
1dd2dd9
Merge branch 'migrate-main-page-to-hugo'
dscho Aug 27, 2023
18b53e1
Merge branch 'migrate-about-to-hugo'
dscho Aug 27, 2023
5185967
Merge branch 'migrate-community-to-hugo'
dscho Oct 14, 2023
e508814
Merge branch 'migrate-guis-to-hugo'
dscho Aug 27, 2023
1c0257c
Merge branch 'migrate-logos-to-hugo'
dscho Aug 27, 2023
ce1cd81
Merge branch 'migrate-downloads-to-hugo'
dscho Aug 27, 2023
c761def
Merge branch 'migrate-docs-main-page-to-hugo'
dscho Aug 27, 2023
1a513a4
Merge branch 'migrate-more-docs-landing-pages-to-hugo'
dscho Aug 27, 2023
ec49526
Merge branch 'migrate-videos-to-hugo'
dscho Aug 27, 2023
2e00de0
Merge branch 'migrate-externals-to-hugo'
dscho Aug 27, 2023
b0acf07
Merge branch 'migrate-site-to-hugo'
dscho Aug 27, 2023
6ccbdc0
Merge branch 'migrate-credential-helpers-to-hugo'
dscho Aug 27, 2023
60f65c8
Merge branch 'migrate-search-to-hugo-and-pagefind'
dscho Aug 27, 2023
33e371c
Merge branch 'support-gh-pages-in-forks'
dscho Aug 27, 2023
7a5303d
Merge branch 'migrate-book-to-hugo'
dscho Aug 27, 2023
6442cfb
Merge branch 'migrate-manual-pages-to-hugo'
dscho Aug 27, 2023
a4a8502
Merge branch 'migrate-translated-manual-pages-to-hugo'
dscho Aug 27, 2023
52c286b
Merge branch 'add-automated-updates'
dscho Aug 27, 2023
2be984a
Merge branch 'describe-architecture-with-hugo'
dscho Aug 27, 2023
d2257a5
Update download data (Git for Windows v2.46.0)
Jul 30, 2024
bdcfcc2
Update manual pages (manually forced rebuild)
Jul 14, 2024
4bd4ba9
Update translated manual pages
Jul 14, 2024
46b1c44
book: update be
Jul 14, 2024
0050828
book: update bg
Jul 14, 2024
290d0bc
book: update cs
Jul 14, 2024
afbe09d
book: update de
Jul 14, 2024
8c01164
book: update en
Jul 14, 2024
57d4a48
book: update es
Jul 14, 2024
1eeec80
book: update fr
Jul 14, 2024
d9c4b03
book: update gr
Jul 14, 2024
4e0c17b
book: update id
Jul 14, 2024
427cc19
book: update it
Jul 14, 2024
f000997
book: update ja
Jul 14, 2024
27d7e25
book: update ko
Jul 14, 2024
fc6d909
book: update mk
Jul 14, 2024
8ffcc39
book: update ms
Jul 14, 2024
0d5579c
book: update nl
Jul 14, 2024
d253dd6
book: update pl
Jul 14, 2024
53cc140
book: update pt-br
Jul 14, 2024
8c02718
book: update pt-pt
Jul 14, 2024
c1a6a09
book: update ru
Jul 14, 2024
bfe273c
book: update sl
Jul 14, 2024
43223fc
book: update sr
Jul 14, 2024
ab779a3
book: update tl
Jul 14, 2024
45b7587
book: update tr
Jul 14, 2024
9b1f517
book: update sv
Jul 14, 2024
843d79c
book: update uk
Jul 14, 2024
e1b1b64
book: update uz
Jul 14, 2024
86addd4
book: update zh
Jul 14, 2024
082859c
book: update zh-tw
Jul 14, 2024
09c3f06
book: update fa
Jul 14, 2024
4f9d3fd
book: update az
Jul 14, 2024
c0d837e
Merge branch 'book-be' of bundle-be/be.bundle into hugo
Jul 14, 2024
875b5d2
Merge branch 'book-bg' of bundle-bg/bg.bundle into hugo
Jul 14, 2024
2608ae4
Merge branch 'book-cs' of bundle-cs/cs.bundle into hugo
Jul 14, 2024
7ba49a7
Merge branch 'book-de' of bundle-de/de.bundle into hugo
Jul 14, 2024
3ee4e84
Merge branch 'book-en' of bundle-en/en.bundle into hugo
Jul 14, 2024
520996a
Merge branch 'book-es' of bundle-es/es.bundle into hugo
Jul 14, 2024
8b82ed6
Merge branch 'book-fr' of bundle-fr/fr.bundle into hugo
Jul 14, 2024
11af0da
Merge branch 'book-gr' of bundle-gr/gr.bundle into hugo
Jul 14, 2024
817c8de
Merge branch 'book-id' of bundle-id/id.bundle into hugo
Jul 14, 2024
1312fd1
Merge branch 'book-it' of bundle-it/it.bundle into hugo
Jul 14, 2024
4139042
Merge branch 'book-ja' of bundle-ja/ja.bundle into hugo
Jul 14, 2024
38a59ae
Merge branch 'book-ko' of bundle-ko/ko.bundle into hugo
Jul 14, 2024
d3d5258
Merge branch 'book-mk' of bundle-mk/mk.bundle into hugo
Jul 14, 2024
9d2619e
Merge branch 'book-ms' of bundle-ms/ms.bundle into hugo
Jul 14, 2024
07b85d3
Merge branch 'book-nl' of bundle-nl/nl.bundle into hugo
Jul 14, 2024
0235553
Merge branch 'book-pl' of bundle-pl/pl.bundle into hugo
Jul 14, 2024
05feb23
Merge branch 'book-pt-br' of bundle-pt-br/pt-br.bundle into hugo
Jul 14, 2024
82f5664
Merge branch 'book-pt-pt' of bundle-pt-pt/pt-pt.bundle into hugo
Jul 14, 2024
c79d649
Merge branch 'book-ru' of bundle-ru/ru.bundle into hugo
Jul 14, 2024
7568c68
Merge branch 'book-sl' of bundle-sl/sl.bundle into hugo
Jul 14, 2024
fa8047c
Merge branch 'book-sr' of bundle-sr/sr.bundle into hugo
Jul 14, 2024
feae773
Merge branch 'book-tl' of bundle-tl/tl.bundle into hugo
Jul 14, 2024
567a8ad
Merge branch 'book-tr' of bundle-tr/tr.bundle into hugo
Jul 14, 2024
2175b3d
Merge branch 'book-sv' of bundle-sv/sv.bundle into hugo
Jul 14, 2024
4dbdc4c
Merge branch 'book-uk' of bundle-uk/uk.bundle into hugo
Jul 14, 2024
9967892
Merge branch 'book-uz' of bundle-uz/uz.bundle into hugo
Jul 14, 2024
1a08600
Merge branch 'book-zh' of bundle-zh/zh.bundle into hugo
Jul 14, 2024
a224f8a
Merge branch 'book-zh-tw' of bundle-zh-tw/zh-tw.bundle into hugo
Jul 14, 2024
659dcf5
Add Playwright-based UI tests
dscho Sep 9, 2024
2a3f95e
playwright: add a few platform-specific tests
dscho Sep 10, 2024
b037fa5
playwright: let the UI tests pass with the Rails app
dscho Sep 10, 2024
2d83ef5
playwright: add a regression test for the `git remote renom` issue
dscho Sep 11, 2024
63fc16b
playwright: add a GitHub workflow to run the tests
dscho Sep 10, 2024
cc86475
Merge branch 'book-fa' of bundle-fa/fa.bundle into hugo
Jul 14, 2024
2f160a5
playwright: auto-start a web server for the special URL localhost:5000
dscho Sep 10, 2024
6bcfb1f
playwright: verify that URLs with question marks work
dscho Sep 11, 2024
98c46ee
ci: run the Playwright tests in every Pull Request
dscho Sep 10, 2024
487f57c
ci: run the Playwright tests on every deployment
dscho Sep 10, 2024
bebabca
Merge branch 'playwright'
dscho Sep 10, 2024
0035367
Update git-version (2.46.1)
Sep 14, 2024
b06d5d0
Update manual pages (2.46.1)
Sep 14, 2024
a22b5f4
Update download data (Git for Windows v2.46.1)
Sep 18, 2024
05eb611
book: update sl
Sep 19, 2024
a83014c
Add a `CNAME` file
dscho Sep 20, 2024
0053f5f
deploy: stop minifying
dscho Sep 20, 2024
3b26ef6
playwright: remove superfluous semicolons
dscho Sep 20, 2024
4f88ad3
playwright: attach helpful screenshots on errors
dscho Sep 20, 2024
af845f8
playwright: verify that `isRailsApp` is correct
dscho Sep 20, 2024
cd3b524
deploy(playwright): test the deployed pages, not Cloudflare's caches
dscho Sep 20, 2024
b1986a3
playwright: stop expecting git-scm.com to be the Rails app
dscho Sep 20, 2024
cb4696d
deploy: copy back a couple files to help transitioning away from Rails
dscho Sep 23, 2024
be57dbd
search: be prepared for the transition from the Rails app
dscho Sep 23, 2024
6635ab1
search: be even more prepared for the transition from the Rails app
dscho Sep 23, 2024
edd5435
Update download data (Git for Windows v2.46.2)
Sep 24, 2024
20b702c
Update git-version (2.46.2)
Sep 24, 2024
d09d33d
Update manual pages (2.46.2)
Sep 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
1 change: 0 additions & 1 deletion .env.example

This file was deleted.

1 change: 0 additions & 1 deletion .gemset

This file was deleted.

183 changes: 183 additions & 0 deletions .github/actions/deploy-to-github-pages/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
name: 'Run Hugo/Pagefind and deploy to GitHub Pages'
description: 'Runs Hugo and Pagefind and then deploys the result to GitHub Pages.'
# This composite Action requires the following things in the calling workflow:
#
# permissions:
# contents: write # to push changes (if any)
# pages: write # to deploy to GitHub Pages
# id-token: write # to verify that the deployment source is legit
# environment:
# name: github-pages
# url: ${{ steps.<id-of-deployment-step>.outputs.url }}
inputs:
github-token:
description: The GitHub token used to create an authenticated client
default: ${{ github.token }}
required: true
outputs:
url:
description: The URL to which the site was deployed
value: ${{ steps.deploy.outputs.page_url }}
runs:
using: "composite"
steps:
- name: push changes (if needed)
shell: bash
run: |
test "$(git rev-parse HEAD)" = "$(git rev-parse refs/remotes/origin/${{ github.ref_name }})" ||
git push origin HEAD:${{ github.ref }}

- name: un-sparse worktree to prepare for deployment
shell: bash
run: git sparse-checkout disable

- name: setup GitHub Pages
id: pages
uses: actions/configure-pages@v5

- name: configure Hugo and Pagefind version
shell: bash
run: |
set -x &&
echo "HUGO_VERSION=$(sed -n 's/^ *hugo_version: *//p' <hugo.yml)" >>$GITHUB_ENV
echo "PAGEFIND_VERSION=$(sed -n 's/^ *pagefind_version: *//p' <hugo.yml)" >>$GITHUB_ENV

- name: install Hugo ${{ env.HUGO_VERSION }}
shell: bash
run: |
set -x &&
curl -Lo /tmp/hugo.deb https://github.com/gohugoio/hugo/releases/download/v$HUGO_VERSION/hugo_extended_${HUGO_VERSION}_linux-amd64.deb &&
sudo dpkg -i /tmp/hugo.deb

- name: run Hugo to build the pages
env:
HUGO_RELATIVEURLS: false
shell: bash
run: hugo config && hugo --baseURL "${{ steps.pages.outputs.base_url }}/"

- name: run Pagefind ${{ env.PAGEFIND_VERSION }} to build the search index
shell: bash
run: npx -y pagefind@${{ env.PAGEFIND_VERSION }} --site public

- name: Temporarily copy some Rails assets to help the transition
shell: bash
run: |
# To help with the transition from the Rails app to the Hugo/Pagefind site, where
# at least for a while the cached version of git-scm.com might be served via
# Cloudflare, according to the first transition attempt on Sep 20, 2024, potentially
# partially, i.e. _some_ assets might still be cached, _some_ others might not, let's
# copy the most prominent assets to the new page so that, say, the original front page
# won't fail to load the style sheet and Javascript libraries that it needs.
set -x &&
mkdir -p public/assets &&
for f in application-93865c5c820c24f4c599e8b9c544bcd8a0d03260f9b16c9ba80b6a00082112c9.css \
application-f7a750114a26afea236a5cc26f6ff3925a14c5901e9ea9018fb869432d0cbee3.js \
modernize-b3ebe0c31c24f230dc62179d3e1030d2e57a53b1668d9382c0a27dbd44a94beb.js
do
curl -Lfo public/assets/$f https://git-scm.com/assets/$f ||
echo "::error::could not copy $f from https://git-scm.com/" >&2
done

- name: upload GitHub Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./public

- name: deploy
id: deploy
uses: actions/deploy-pages@v4

- name: construct `--remap` option for lychee
id: remap
shell: bash
run: |
base_url='${{ steps.pages.outputs.base_url }}'
echo "result=$(echo "$base_url" |
sed 's|^\(.*\)\(/git-scm\.com\)$|(\1)?\2(.*)|') file://$PWD/public\$2" \
>>$GITHUB_OUTPUT

- name: check for broken links
id: lychee
uses: lycheeverse/lychee-action@d4128702eae98bbc5ecf74df0165a8156c80920a # until an official version is out that includes https://github.com/lycheeverse/lychee/pull/1422
with:
lycheeVersion: nightly # until an official version includes https://github.com/lycheeverse/lychee/pull/1422
args: >-
--offline
--fallback-extensions html
--base '${{ steps.pages.outputs.base_url }}'
--remap '${{ steps.remap.outputs.result }}'
--exclude file:///path/to/repo.git/
--exclude file:///caminho/para/o/reposit%C3%B3rio.git/
--exclude file:///ruta/a/repositorio.git/
--exclude file:///sl%C3%B3%C3%B0/til/hirsla.git/
--exclude file:///Pfad/zum/Repo.git/
--exclude file:///chemin/du/d%C3%A9p%C3%B4t.git/
--exclude file:///srv/git/project.git
public/
output: lychee.md
jobSummary: true
fail: false
failIfEmpty: false # needed because its default overrides `fail = false`

- name: ${{ env.lychee_exit_code != '0' && 'maybe close' || 'open or update' }} link checker issue
uses: actions/github-script@v7
with:
github-token: ${{ inputs.github-token }}
script: |
const fs = await import('fs')
// GitHub issues can only have 64k characters in their body
const body = (s => {
if (s.length < 65535) return s
return s.replace(/^([^]{0,65000}\n)[^]*\n(.+)\n?$/, '$1\n[...]\n\n$2')
})(await fs.promises.readFile('lychee.md', 'utf8'))

const issues = await (async () => {
const req = { owner: context.repo.owner, repo: context.repo.repo }
const q = `"Link+Checker+Report"+in:title+is:issue+label:linkchecker+is:open+repo:${req.owner}/${req.repo}`
try {
return await github.rest.search.issuesAndPullRequests({ ...req, q, sort: 'created', per_page: 1 })
} catch (e) {
console.log(`Warning: ${e}; sleeping for 30 seconds and falling back to calling listForRepo()`)
await new Promise(r => setTimeout(r, 30000))

const issues = await github.rest.issues.listForRepo({...req, state: 'open', per_page: 100})
return {
data: {
items: issues.data.filter(
e => e.title === 'Link Checker Report'
&& e.labels.filter(l => l.name === 'linkchecker').length > 0
)
}
}
}
})()

if (issues.data.items.length === 0) {
if (process.env.lychee_exit_code !== '0') {
await github.rest.issues.create({ ...req, title: 'Link Checker Report', body, labels: ['linkchecker'] })
}
} else {
req.issue_number = issues.data.items[0].number
await github.rest.issues.createComment({ ...req, body })
if (process.env.lychee_exit_code === '0') {
await github.rest.issues.update({ ...req, state: 'closed' })
}
}

- name: Install @playwright/test
shell: bash
run: npm install @playwright/test
- name: Edit /etc/hosts to map git-scm.com to GitHub
shell: bash
# This side-steps the Cloudflare caches
run: sudo sh -c 'echo "185.199.108.153 git-scm.com" >>/etc/hosts'
- name: Run Playwright tests
shell: bash
env:
PLAYWRIGHT_TEST_URL: ${{ steps.pages.outputs.base_url }}
run: npx playwright test --project=chrome
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
85 changes: 74 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,85 @@
name: CI
on: pull_request
on: [pull_request]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: ruby setup
uses: ruby/setup-ruby@v1
- name: configure Hugo and Pagefind version
run: |
set -x &&
echo "HUGO_VERSION=$(sed -n 's/^ *hugo_version: *//p' <hugo.yml)" >>$GITHUB_ENV
echo "PAGEFIND_VERSION=$(sed -n 's/^ *pagefind_version: *//p' <hugo.yml)" >>$GITHUB_ENV

- name: install Hugo ${{ env.HUGO_VERSION }}
run: |
set -x &&
curl -Lo /tmp/hugo.deb https://github.com/gohugoio/hugo/releases/download/v$HUGO_VERSION/hugo_extended_${HUGO_VERSION}_linux-amd64.deb &&
sudo dpkg -i /tmp/hugo.deb

- name: run Hugo to build the pages
run: hugo

- name: ensure that there are no absolute URLs
run: |
set -x
if git grep --untracked --no-exclude-standard "\\(href\|src\) *= *[\"']/" \
-- public/ ':^public/js/jquery*' >/tmp/abs-urls.txt
then
cat /tmp/abs-urls.txt
exit 1
fi

- name: run Pagefind ${{ env.PAGEFIND_VERSION }} to build the search index
run: npx -y pagefind@${{ env.PAGEFIND_VERSION }} --site public

- name: build tar archive
run: cd public && tar czvf ../pages.tar.gz *

- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
bundler-cache: true
name: pages
path: pages.tar.gz

- name: rails setup
run: bundle exec rake db:create db:schema:load
- name: verify search results
run: |
set -x
res=0
for term in commit config log rev-parse
do
node ./script/run-pagefind.js "$term" | tee search.results >&2
grep "^1. /docs/git-$term\\.html" search.results || {
echo "::error::Search for $term failed to show the manual page first" >&2
res=1
}
done
exit $res

- name: rubocop
run: bundle exec rubocop -P
- name: check for broken links
id: lychee
uses: lycheeverse/lychee-action@d4128702eae98bbc5ecf74df0165a8156c80920a # until an official version is out that includes https://github.com/lycheeverse/lychee/pull/1422
with:
lycheeVersion: nightly # until an official version includes https://github.com/lycheeverse/lychee/pull/1422
args: >-
--offline
--fallback-extensions html
--exclude file:///path/to/repo.git/
--exclude file:///caminho/para/o/reposit%C3%B3rio.git/
--exclude file:///ruta/a/repositorio.git/
--exclude file:///sl%C3%B3%C3%B0/til/hirsla.git/
--exclude file:///Pfad/zum/Repo.git/
--exclude file:///chemin/du/d%C3%A9p%C3%B4t.git/
--exclude file:///srv/git/project.git
public/
output: lychee.md
jobSummary: true

- name: rspec
run: bundle exec rspec
- name: Install @playwright/test
run: npm install @playwright/test
- name: Run Playwright tests
env:
PLAYWRIGHT_TEST_URL: http://localhost:5000/
run: npx playwright test --project=chrome
23 changes: 23 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Deploy to GitHub Pages

on:
workflow_dispatch:
push:
branches:
- gh-pages

jobs:
deploy:
runs-on: ubuntu-latest
permissions:
pages: write # to deploy to GitHub Pages
id-token: write # to verify that the deployment source is legit
issues: write # to open tickets upon broken links
environment:
name: github-pages
url: ${{ steps.deploy.outputs.url }}
steps:
- uses: actions/checkout@v4
- name: deploy to GitHub Pages
id: deploy
uses: ./.github/actions/deploy-to-github-pages
33 changes: 33 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Playwright Tests
on:
workflow_dispatch:
inputs:
url:
description: 'URL to test'
required: true
default: 'https://git-scm.com'
assume-rails-app:
description: 'Whether the URL points to the original Rails app variant of the site'
required: false
default: 'false'
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install @playwright/test
run: npm install @playwright/test
- name: Run Playwright tests
env:
PLAYWRIGHT_TEST_URL: ${{ github.event.inputs.url }}
PLAYWRIGHT_ASSUME_RAILS_APP: ${{ github.event.inputs.assume-rails-app }}
run: npx playwright test --project=chrome
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
Loading
Loading