mirror of
https://github.com/LnL7/nix-darwin.git
synced 2025-03-31 04:04:45 +00:00
ci: deploy the website from GitHub Actions
This commit is contained in:
parent
a5af2a5b22
commit
2c77fdbfba
4 changed files with 76 additions and 35 deletions
35
.github/workflows/update-manual.yml
vendored
35
.github/workflows/update-manual.yml
vendored
|
@ -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
45
.github/workflows/update-website.yml
vendored
Normal 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
|
24
doc/website/index.html
Normal file
24
doc/website/index.html
Normal 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>
|
|
@ -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;
|
||||
};
|
||||
})));
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue