1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-03-31 04:04:45 +00:00

Merge pull request #1406 from emilazy/push-nwzyqrynuvyo

ci: deploy the website from GitHub Actions
This commit is contained in:
Emily 2025-03-29 04:10:02 +00:00 committed by GitHub
commit feb64b5364
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 77 additions and 36 deletions

View file

@ -1,35 +0,0 @@
name: Update manual
on:
push:
branches:
- master
jobs:
update-manual:
runs-on: macos-13
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
# So that we fetch all branches, since we need to checkout the `gh-pages` branch later.
fetch-depth: 0
- name: Install Nix
uses: cachix/install-nix-action@v30
- name: Build manual
run: |
nix build .#manualHTML
- name: Push update to manual
run: |
git checkout gh-pages
rm -rf manual
cp -R result/share/doc/darwin manual
rm result
git checkout master -- README.md
git config user.name github-actions
git config user.email github-actions@github.com
git add --all
git commit -m "Update manual"
git push

45
.github/workflows/update-website.yml vendored Normal file
View file

@ -0,0 +1,45 @@
name: Update website
on:
push:
branches:
- master
permissions: {}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build
runs-on: macos-14
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
persist-credentials: false
- name: Install Nix
uses: cachix/install-nix-action@02a151ada4993995686f9ed4f1be7cfbb229e56f
- name: Build website
run: nix build .#website -o _site
- name: Upload website
id: deployment
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa
# See: <https://github.com/actions/deploy-pages?tab=readme-ov-file#usage>
deploy:
name: Deploy
needs: build
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-24.04
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e

View file

@ -1,4 +1,4 @@
[<img src="https://nix-darwin.github.io/nix-darwin/images/nix-darwin.png" width="200px" alt="logo" />](https://github.com/nix-darwin/nix-darwin)
[<img src="https://github.com/user-attachments/assets/0e1a77ac-6739-4153-bd24-abd3a5e143f5" width="200px" alt="logo" />](https://github.com/nix-darwin/nix-darwin)
# nix-darwin

24
doc/website/index.html Normal file
View file

@ -0,0 +1,24 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>nix-darwin</title>
<script>
window.location.replace("https://github.com/nix-darwin/nix-darwin?tab=readme-ov-file#readme");
</script>
<noscript>
<meta
http-equiv="refresh"
content="0; url=https://github.com/nix-darwin/nix-darwin?tab=readme-ov-file#readme">
</noscript>
</head>
<body>
<h1>nix-darwin</h1>
<p>
nix-darwin is a declarative configuration system for macOS, based
on Nix. See the
<a href="https://github.com/nix-darwin/nix-darwin?tab=readme-ov-file#readme">GitHub
repository</a> for more information.
</p>
</body>
</html>

View file

@ -78,6 +78,13 @@
default = self.packages.${system}.darwin-rebuild;
inherit (pkgs) darwin-option darwin-rebuild darwin-version darwin-uninstaller;
# TODO: Include manuals for active release branches in the website.
# (This may involve moving it to a separate repository.)
website = pkgs.linkFarm "nix-darwin-website" {
"index.html" = ./doc/website/index.html;
manual = self.packages.${system}.manualHTML;
};
})));
};
}