ci: unify/simplify documentation and ci nix steps
Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
parent
4312ac91c1
commit
a589a34d15
2 changed files with 31 additions and 32 deletions
3
.github/workflows/ci.yml
vendored
3
.github/workflows/ci.yml
vendored
|
@ -64,6 +64,9 @@ jobs:
|
||||||
|
|
||||||
- name: Install Nix
|
- name: Install Nix
|
||||||
uses: DeterminateSystems/nix-installer-action@main
|
uses: DeterminateSystems/nix-installer-action@main
|
||||||
|
with:
|
||||||
|
diagnostic-endpoint: ""
|
||||||
|
extra-conf: "experimental-features = nix-command flakes"
|
||||||
|
|
||||||
- name: Enable Cachix binary cache
|
- name: Enable Cachix binary cache
|
||||||
run: |
|
run: |
|
||||||
|
|
60
.github/workflows/documentation.yml
vendored
60
.github/workflows/documentation.yml
vendored
|
@ -31,7 +31,6 @@ concurrency:
|
||||||
jobs:
|
jobs:
|
||||||
docs:
|
docs:
|
||||||
name: Documentation and GitHub Pages
|
name: Documentation and GitHub Pages
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
|
@ -50,52 +49,49 @@ jobs:
|
||||||
if: github.event_name != 'pull_request'
|
if: github.event_name != 'pull_request'
|
||||||
uses: actions/configure-pages@v5
|
uses: actions/configure-pages@v5
|
||||||
|
|
||||||
- name: Install Nix (with flakes and nix-command enabled)
|
- name: Install Nix
|
||||||
uses: cachix/install-nix-action@v27
|
uses: DeterminateSystems/nix-installer-action@main
|
||||||
with:
|
with:
|
||||||
nix_path: nixpkgs=channel:nixos-unstable
|
diagnostic-endpoint: ""
|
||||||
|
extra-conf: "experimental-features = nix-command flakes"
|
||||||
|
|
||||||
# Add `nix-community`, Crane, upstream Conduit, and conduwuit binary caches
|
- name: Enable Cachix binary cache
|
||||||
extra_nix_config: |
|
|
||||||
experimental-features = nix-command flakes
|
|
||||||
extra-substituters = https://nix-community.cachix.org
|
|
||||||
extra-trusted-public-keys = nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=
|
|
||||||
extra-substituters = https://crane.cachix.org
|
|
||||||
extra-trusted-public-keys = crane.cachix.org-1:8Scfpmn9w+hGdXH/Q9tTLiYAE/2dnJYRJP7kl80GuRk=
|
|
||||||
extra-substituters = https://attic.kennel.juneis.dog/conduit
|
|
||||||
extra-trusted-public-keys = conduit:eEKoUwlQGDdYmAI/Q/0slVlegqh/QmAvQd7HBSm21Wk=
|
|
||||||
extra-substituters = https://attic.kennel.juneis.dog/conduwuit
|
|
||||||
extra-trusted-public-keys = conduwuit:BbycGUgTISsltcmH0qNjFR9dbrQNYgdIAcmViSGoVTE=
|
|
||||||
|
|
||||||
- name: Add alternative Nix binary caches if specified
|
|
||||||
if: ${{ (env.ATTIC_ENDPOINT != '') && (env.ATTIC_PUBLIC_KEY != '') }}
|
|
||||||
run: |
|
run: |
|
||||||
echo "extra-substituters = ${{ env.ATTIC_ENDPOINT }}" >> /etc/nix/nix.conf
|
nix profile install nixpkgs#cachix
|
||||||
echo "extra-trusted-public-keys = ${{ env.ATTIC_PUBLIC_KEY }}" >> /etc/nix/nix.conf
|
cachix use crane
|
||||||
|
cachix use nix-community
|
||||||
|
|
||||||
- name: Pop/push Magic Nix Cache
|
- name: Configure Magic Nix Cache
|
||||||
uses: DeterminateSystems/magic-nix-cache-action@main
|
uses: DeterminateSystems/magic-nix-cache-action@main
|
||||||
with:
|
with:
|
||||||
diagnostic-endpoint: ""
|
diagnostic-endpoint: ""
|
||||||
upstream-cache: "https://attic.kennel.juneis.dog"
|
upstream-cache: "https://attic.kennel.juneis.dog"
|
||||||
|
|
||||||
- name: Configure `nix-direnv`
|
- name: Apply Nix binary cache configuration
|
||||||
run: |
|
run: |
|
||||||
echo 'source $HOME/.nix-profile/share/nix-direnv/direnvrc' > "$HOME/.direnvrc"
|
sudo tee -a /etc/nix/nix.conf > /dev/null <<EOF
|
||||||
|
extra-substituters = https://attic.kennel.juneis.dog/conduihttps://attic.kennel.juneis.dog/conduwuit https://cache.lix.systems
|
||||||
|
extra-trusted-public-keys = conduit:eEKoUwlQGDdYmAI/Q/0slVlegqh/QmAvQd7HBSm21Wkconduwuit:BbycGUgTISsltcmH0qNjFR9dbrQNYgdIAcmViSGoVTEcache.lix.systems:aBnZUw8zA7H35Cz2RyKFVs3H4PlGTLawyY5KRbvJR8o=
|
||||||
|
EOF
|
||||||
|
|
||||||
- name: Install `direnv` and `nix-direnv`
|
- name: Use alternative Nix binary caches if specified
|
||||||
run: nix-env -f "<nixpkgs>" -iA direnv -iA nix-direnv
|
if: ${{ (env.ATTIC_ENDPOINT != '') && (env.ATTIC_PUBLIC_KEY != '') }}
|
||||||
|
run: |
|
||||||
|
sudo tee -a /etc/nix/nix.conf > /dev/null <<EOF
|
||||||
|
extra-substituters = ${{ env.ATTIC_ENDPOINT }}
|
||||||
|
extra-trusted-public-keys = ${{ env.ATTIC_PUBLIC_KEY }}
|
||||||
|
EOF
|
||||||
|
|
||||||
# Do this to shorten the logs for the real CI step
|
- name: Prepare build environment
|
||||||
- name: Populate `/nix/store`
|
run: |
|
||||||
run: nix develop --command true
|
echo 'source $HOME/.nix-profile/share/nix-direnv/direnvrc' > "$HOME/.direnvrc"
|
||||||
|
nix profile install --impure --inputs-from . nixpkgs#direnv nixpkgs#nix-direnv
|
||||||
- name: Allow direnv
|
direnv allow
|
||||||
run: direnv allow
|
nix develop --command true
|
||||||
|
|
||||||
- name: Cache CI dependencies
|
- name: Cache CI dependencies
|
||||||
run: |
|
run: |
|
||||||
./bin/nix-build-and-cache ci
|
bin/nix-build-and-cache ci
|
||||||
|
|
||||||
- name: Build documentation (book)
|
- name: Build documentation (book)
|
||||||
run: |
|
run: |
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue