Compare commits
2 commits
e5c37d1c8b
...
12e7174057
Author | SHA1 | Date | |
---|---|---|---|
12e7174057 | |||
48546bb730 |
|
@ -1,30 +0,0 @@
|
||||||
name: "Frontend: Build & Deploy to Netlify"
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
pull_request:
|
|
||||||
paths:
|
|
||||||
- "flake.nix"
|
|
||||||
- "flake.lock"
|
|
||||||
- "frontend/**"
|
|
||||||
- "VERSION"
|
|
||||||
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-and-deploy:
|
|
||||||
runs-on: nixos-unstable
|
|
||||||
steps:
|
|
||||||
- name: Checking out the repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Enable flakes
|
|
||||||
run: |
|
|
||||||
echo 'experimental-features = nix-command flakes' >>/etc/nix/nix.conf
|
|
||||||
|
|
||||||
- name: Building search.nixos.org
|
|
||||||
run: |
|
|
||||||
nix -vL build .#frontend
|
|
||||||
mkdir ./dist
|
|
||||||
cp -RL ./result/* ./dist/
|
|
23
.github/actions/common-setup/action.yml
vendored
Normal file
23
.github/actions/common-setup/action.yml
vendored
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
name: Setup Environment
|
||||||
|
inputs:
|
||||||
|
GITHUB_TOKEN:
|
||||||
|
required: true
|
||||||
|
description: "GitHub access token used to prevent GitHub's rate limit for unauthenticated requests"
|
||||||
|
CACHIX_SIGNING_KEY: # determines what node version to install
|
||||||
|
required: true
|
||||||
|
description: 'Cachix Signing Key'
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- name: Installing Nix
|
||||||
|
uses: cachix/install-nix-action@v27
|
||||||
|
with:
|
||||||
|
nix_path: nixpkgs=channel:nixpkgs-unstable
|
||||||
|
extra_nix_config: |
|
||||||
|
access-tokens = github.com=${{ inputs.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- uses: cachix/cachix-action@v15
|
||||||
|
with:
|
||||||
|
name: nixos-search
|
||||||
|
signingKey: '${{ inputs.CACHIX_SIGNING_KEY }}'
|
|
@ -12,14 +12,18 @@ on:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-flake-info:
|
build-flake-info:
|
||||||
runs-on: nixos-unstable
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checking out the repository
|
- name: Checking out the repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Enable flakes
|
- name: Setup
|
||||||
run: |
|
uses: ./.github/actions/common-setup
|
||||||
echo 'experimental-features = nix-command flakes' >>/etc/nix/nix.conf
|
with:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
CACHIX_SIGNING_KEY: ${{ secrets.CACHIX_SIGNING_KEY }}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- name: Building flake-info
|
- name: Building flake-info
|
||||||
run: |
|
run: |
|
|
@ -8,19 +8,24 @@ on:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
automatic-custom-flakes-check:
|
automatic-custom-flakes-check:
|
||||||
runs-on: nixos-unstable
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: true
|
fail-fast: true
|
||||||
|
|
||||||
env:
|
env:
|
||||||
RUST_LOG: debug
|
RUST_LOG: debug
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Checking out the repository
|
- name: Checking out the repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Enable flakes
|
- name: Setup
|
||||||
run: |
|
uses: ./.github/actions/common-setup
|
||||||
echo 'experimental-features = nix-command flakes' >>/etc/nix/nix.conf
|
with:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
CACHIX_SIGNING_KEY: ${{ secrets.CACHIX_SIGNING_KEY }}
|
||||||
|
|
||||||
- name: Try importing all custom flakes
|
- name: Try importing all custom flakes
|
||||||
run: |
|
run: |
|
51
.github/workflows/frontend.yml
vendored
Normal file
51
.github/workflows/frontend.yml
vendored
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
name: "Frontend: Build & Deploy to Netlify"
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- "flake.nix"
|
||||||
|
- "flake.lock"
|
||||||
|
- "frontend/**"
|
||||||
|
- "VERSION"
|
||||||
|
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-deploy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checking out the repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup
|
||||||
|
uses: ./.github/actions/common-setup
|
||||||
|
with:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
CACHIX_SIGNING_KEY: ${{ secrets.CACHIX_SIGNING_KEY }}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
- name: Building search.nixos.org
|
||||||
|
run: |
|
||||||
|
nix -vL build .#frontend
|
||||||
|
mkdir ./dist
|
||||||
|
cp -RL ./result/* ./dist/
|
||||||
|
|
||||||
|
- name: Deploy to Netlify
|
||||||
|
uses: nwtgck/actions-netlify@v3.0
|
||||||
|
env:
|
||||||
|
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
||||||
|
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
|
||||||
|
with:
|
||||||
|
production-branch: 'main'
|
||||||
|
production-deploy: ${{ github.event_name == 'push' }}
|
||||||
|
publish-dir: './dist'
|
||||||
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
deploy-message: 'Deploy from GitHub Actions'
|
||||||
|
enable-pull-request-comment: true
|
||||||
|
overwrites-pull-request-comment: true
|
||||||
|
enable-commit-comment: false
|
||||||
|
enable-commit-status: true
|
||||||
|
if: github.repository_owner == 'NixOS'
|
|
@ -10,8 +10,10 @@ permissions:
|
||||||
issues: write
|
issues: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
nixos-channels:
|
nixos-channels:
|
||||||
runs-on: nixos-unstable
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
matrix: ${{ steps.nixos-channels.outputs.matrix }}
|
matrix: ${{ steps.nixos-channels.outputs.matrix }}
|
||||||
|
|
||||||
|
@ -19,9 +21,11 @@ jobs:
|
||||||
- name: Checking out the repository
|
- name: Checking out the repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Enable flakes
|
- name: Setup
|
||||||
run: |
|
uses: ./.github/actions/common-setup
|
||||||
echo 'experimental-features = nix-command flakes' >>/etc/nix/nix.conf
|
with:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
CACHIX_SIGNING_KEY: ${{ secrets.CACHIX_SIGNING_KEY }}
|
||||||
|
|
||||||
- name: NixOS Channels
|
- name: NixOS Channels
|
||||||
id: nixos-channels
|
id: nixos-channels
|
||||||
|
@ -33,10 +37,12 @@ jobs:
|
||||||
|
|
||||||
import-nixpkgs:
|
import-nixpkgs:
|
||||||
needs: nixos-channels
|
needs: nixos-channels
|
||||||
runs-on: nixos-unstable
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix: ${{ fromJSON(needs.nixos-channels.outputs.matrix) }}
|
matrix: ${{ fromJSON(needs.nixos-channels.outputs.matrix) }}
|
||||||
|
|
||||||
env:
|
env:
|
||||||
RUST_LOG: debug
|
RUST_LOG: debug
|
||||||
FI_ES_EXISTS_STRATEGY: abort
|
FI_ES_EXISTS_STRATEGY: abort
|
||||||
|
@ -46,52 +52,70 @@ jobs:
|
||||||
- name: Checking out the repository
|
- name: Checking out the repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Enable flakes
|
- name: Setup
|
||||||
run: |
|
uses: ./.github/actions/common-setup
|
||||||
echo 'experimental-features = nix-command flakes' >>/etc/nix/nix.conf
|
with:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
CACHIX_SIGNING_KEY: ${{ secrets.CACHIX_SIGNING_KEY }}
|
||||||
|
|
||||||
- name: Import ${{ matrix.channel }} channel
|
- name: Import ${{ matrix.channel }} channel
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
nix run --accept-flake-config .#flake-info -- --push --elastic-schema-version=$(< VERSION) nixpkgs ${{ matrix.channel }}
|
nix run --accept-flake-config .#flake-info -- --push --elastic-schema-version=$(< VERSION) nixpkgs ${{ matrix.channel }}
|
||||||
if: false
|
if: github.repository_owner == 'NixOS'
|
||||||
|
|
||||||
- name: Warmup ${{ matrix.channel }} channel
|
- name: Warmup ${{ matrix.channel }} channel
|
||||||
run: |
|
run: |
|
||||||
for (( i = 0; i < 3; i++ )) do
|
for (( i = 0; i < 3; i++ )) do
|
||||||
curl -sS ${{ secrets.ELASTICSEARCH_URL2 }}/latest-$(< VERSION)-nixos-${{ matrix.channel }}/_search | jq -c '.took // .'
|
curl -sS ${{ secrets.ELASTICSEARCH_URL2 }}/latest-$(< VERSION)-nixos-${{ matrix.channel }}/_search | jq -c '.took // .'
|
||||||
done
|
done
|
||||||
if: false
|
if: github.repository_owner == 'NixOS'
|
||||||
|
|
||||||
|
- name: Create issue if failed
|
||||||
|
if: failure()
|
||||||
|
uses: JasonEtco/create-an-issue@v2
|
||||||
|
with:
|
||||||
|
filename: .github/failing-import-issue.md
|
||||||
|
search_existing: open
|
||||||
|
update_existing: false
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
CHANNEL: ${{ matrix.channel }}
|
||||||
|
|
||||||
import-flakes:
|
import-flakes:
|
||||||
runs-on: nixos-unstable
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
group:
|
group:
|
||||||
- manual
|
- "manual"
|
||||||
|
|
||||||
env:
|
env:
|
||||||
RUST_LOG: debug
|
RUST_LOG: debug
|
||||||
FI_ES_EXISTS_STRATEGY: recreate
|
FI_ES_EXISTS_STRATEGY: recreate
|
||||||
FI_ES_URL: ${{ secrets.ELASTICSEARCH_URL2 }}
|
FI_ES_URL: ${{ secrets.ELASTICSEARCH_URL2 }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Checking out the repository
|
- name: Checking out the repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Enable flakes
|
- name: Setup
|
||||||
run: |
|
uses: ./.github/actions/common-setup
|
||||||
echo 'experimental-features = nix-command flakes' >>/etc/nix/nix.conf
|
with:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
CACHIX_SIGNING_KEY: ${{ secrets.CACHIX_SIGNING_KEY }}
|
||||||
|
|
||||||
- name: Import ${{ matrix.group }} group
|
- name: Import ${{ matrix.group }} group
|
||||||
run: |
|
run: |
|
||||||
nix run --accept-flake-config .#flake-info -- --push --elastic-schema-version=$(< ./VERSION) group ./flakes/${{ matrix.group }}.toml ${{ matrix.group }}
|
nix run --accept-flake-config .#flake-info -- --push --elastic-schema-version=$(< ./VERSION) group ./flakes/${{ matrix.group }}.toml ${{ matrix.group }}
|
||||||
if: false
|
if: github.repository_owner == 'NixOS'
|
||||||
|
|
||||||
- name: Warmup ${{ matrix.group }} group
|
- name: Warmup ${{ matrix.group }} group
|
||||||
run: |
|
run: |
|
||||||
for (( i = 0; i < 3; i++ )) do
|
for (( i = 0; i < 3; i++ )) do
|
||||||
curl -sS ${{ secrets.ELASTICSEARCH_URL2 }}/latest-$(< VERSION)-group-${{ matrix.group }}/_search | jq -c '.took // .'
|
curl -sS ${{ secrets.ELASTICSEARCH_URL2 }}/latest-$(< VERSION)-group-${{ matrix.group }}/_search | jq -c '.took // .'
|
||||||
done
|
done
|
||||||
if: false
|
if: github.repository_owner == 'NixOS'
|
|
@ -1,5 +1,4 @@
|
||||||
name: "Update flake.lock"
|
name: update-flake-lock
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch: # allows manual triggering
|
workflow_dispatch: # allows manual triggering
|
||||||
schedule:
|
schedule:
|
||||||
|
@ -7,15 +6,14 @@ on:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lockfile:
|
lockfile:
|
||||||
runs-on: nixos-unstable
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
- name: Install Nix
|
||||||
- name: Enable flakes
|
uses: cachix/install-nix-action@v27
|
||||||
run: |
|
with:
|
||||||
echo 'experimental-features = nix-command flakes' >>/etc/nix/nix.conf
|
extra_nix_config: |
|
||||||
|
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Update flake.lock
|
- name: Update flake.lock
|
||||||
uses: DeterminateSystems/update-flake-lock@v22
|
uses: DeterminateSystems/update-flake-lock@v22
|
||||||
if: false
|
|
12
flake.lock
12
flake.lock
|
@ -21,11 +21,11 @@
|
||||||
"nixos-infra": {
|
"nixos-infra": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1717510161,
|
"lastModified": 1718459216,
|
||||||
"narHash": "sha256-BiZudUcdFCpW9d8IXiPHXhKP1vTVqcDrQRtd/dLr7n0=",
|
"narHash": "sha256-+lOSTU8TjJZvNpcqANrTYarIdrMo4eUTYW1/CLWJ0No=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "infra",
|
"repo": "infra",
|
||||||
"rev": "5e2b57f9a5bc43b9fd3eb822caaa7ddf0448b2b3",
|
"rev": "ca11a27e5609a152b5e9d9293c4ea99e9234d9e6",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -36,11 +36,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1717786204,
|
"lastModified": 1718318537,
|
||||||
"narHash": "sha256-4q0s6m0GUcN7q+Y2DqD27iLvbcd1G50T2lv08kKxkSI=",
|
"narHash": "sha256-4Zu0RYRcAY/VWuu6awwq4opuiD//ahpc2aFHg2CWqFY=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "051f920625ab5aabe37c920346e3e69d7d34400e",
|
"rev": "e9ee548d90ff586a6471b4ae80ae9cfcbceb3420",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
@ -654,7 +654,7 @@ viewResultItem nixosChannels channel showInstallDetails show item =
|
||||||
[ pre [ class "code-block shell-command" ]
|
[ pre [ class "code-block shell-command" ]
|
||||||
[ text "# without flakes:\nnix-env -iA nixpkgs."
|
[ text "# without flakes:\nnix-env -iA nixpkgs."
|
||||||
, strong [] [ text item.source.attr_name ]
|
, strong [] [ text item.source.attr_name ]
|
||||||
, text "# with flakes:\nnix profile install nixpkgs#"
|
, text "\n# with flakes:\nnix profile install nixpkgs#"
|
||||||
, strong [] [ text item.source.attr_name ]
|
, strong [] [ text item.source.attr_name ]
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in a new issue