2022-03-17 22:00:10 +00:00
|
|
|
name: "Hourly import to Elasticsearch"
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
schedule:
|
|
|
|
- cron: '0 * * * *'
|
|
|
|
|
2023-02-07 15:32:04 +00:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
issues: write
|
|
|
|
|
2022-03-17 22:00:10 +00:00
|
|
|
jobs:
|
2022-04-24 21:48:01 +00:00
|
|
|
nixos-channels:
|
2024-06-14 20:53:40 +00:00
|
|
|
runs-on: nixos-unstable
|
2022-04-24 21:48:01 +00:00
|
|
|
outputs:
|
|
|
|
matrix: ${{ steps.nixos-channels.outputs.matrix }}
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checking out the repository
|
2023-09-05 08:32:25 +00:00
|
|
|
uses: actions/checkout@v4
|
2022-04-24 21:48:01 +00:00
|
|
|
|
2024-06-14 20:53:40 +00:00
|
|
|
- name: Enable flakes
|
|
|
|
run: |
|
|
|
|
echo 'experimental-features = nix-command flakes' >>/etc/nix/nix.conf
|
2022-04-24 21:48:01 +00:00
|
|
|
|
|
|
|
- name: NixOS Channels
|
|
|
|
id: nixos-channels
|
|
|
|
run: |
|
2024-05-02 15:01:00 +00:00
|
|
|
nix build --accept-flake-config -L .#nixosChannels
|
2022-04-24 21:48:01 +00:00
|
|
|
channels="{\"channel\": $(< ./result)}"
|
2023-05-10 17:46:01 +00:00
|
|
|
echo "$channels"
|
|
|
|
echo "matrix=$channels" >> "$GITHUB_OUTPUT"
|
2022-04-24 21:48:01 +00:00
|
|
|
|
2022-03-17 22:00:10 +00:00
|
|
|
import-nixpkgs:
|
2022-04-24 21:48:01 +00:00
|
|
|
needs: nixos-channels
|
2024-06-14 20:53:40 +00:00
|
|
|
runs-on: nixos-unstable
|
2022-03-17 22:00:10 +00:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
2022-04-24 21:48:01 +00:00
|
|
|
matrix: ${{ fromJSON(needs.nixos-channels.outputs.matrix) }}
|
2022-03-17 22:00:10 +00:00
|
|
|
env:
|
|
|
|
RUST_LOG: debug
|
|
|
|
FI_ES_EXISTS_STRATEGY: abort
|
2022-11-03 09:56:05 +00:00
|
|
|
FI_ES_URL: ${{ secrets.ELASTICSEARCH_URL2 }}
|
2022-03-17 22:00:10 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checking out the repository
|
2023-09-05 08:32:25 +00:00
|
|
|
uses: actions/checkout@v4
|
2022-03-17 22:00:10 +00:00
|
|
|
|
2024-06-14 20:53:40 +00:00
|
|
|
- name: Enable flakes
|
|
|
|
run: |
|
|
|
|
echo 'experimental-features = nix-command flakes' >>/etc/nix/nix.conf
|
2022-03-17 22:00:10 +00:00
|
|
|
|
|
|
|
- name: Import ${{ matrix.channel }} channel
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
run: |
|
2024-05-02 15:01:00 +00:00
|
|
|
nix run --accept-flake-config .#flake-info -- --push --elastic-schema-version=$(< VERSION) nixpkgs ${{ matrix.channel }}
|
2024-06-14 20:53:40 +00:00
|
|
|
if: false
|
2022-03-17 22:00:10 +00:00
|
|
|
|
|
|
|
- name: Warmup ${{ matrix.channel }} channel
|
|
|
|
run: |
|
|
|
|
for (( i = 0; i < 3; i++ )) do
|
2022-11-03 09:56:05 +00:00
|
|
|
curl -sS ${{ secrets.ELASTICSEARCH_URL2 }}/latest-$(< VERSION)-nixos-${{ matrix.channel }}/_search | jq -c '.took // .'
|
2022-03-17 22:00:10 +00:00
|
|
|
done
|
2024-06-14 20:53:40 +00:00
|
|
|
if: false
|
2022-03-17 22:00:10 +00:00
|
|
|
|
|
|
|
import-flakes:
|
2024-06-14 20:53:40 +00:00
|
|
|
runs-on: nixos-unstable
|
2022-03-17 22:00:10 +00:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
group:
|
2024-06-14 20:53:40 +00:00
|
|
|
- manual
|
2022-03-17 22:00:10 +00:00
|
|
|
env:
|
|
|
|
RUST_LOG: debug
|
|
|
|
FI_ES_EXISTS_STRATEGY: recreate
|
2022-11-03 09:56:05 +00:00
|
|
|
FI_ES_URL: ${{ secrets.ELASTICSEARCH_URL2 }}
|
2022-03-17 22:00:10 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checking out the repository
|
2023-09-05 08:32:25 +00:00
|
|
|
uses: actions/checkout@v4
|
2022-03-17 22:00:10 +00:00
|
|
|
|
2024-06-14 20:53:40 +00:00
|
|
|
- name: Enable flakes
|
|
|
|
run: |
|
|
|
|
echo 'experimental-features = nix-command flakes' >>/etc/nix/nix.conf
|
2022-03-17 22:00:10 +00:00
|
|
|
|
|
|
|
- name: Import ${{ matrix.group }} group
|
|
|
|
run: |
|
2024-05-02 15:01:00 +00:00
|
|
|
nix run --accept-flake-config .#flake-info -- --push --elastic-schema-version=$(< ./VERSION) group ./flakes/${{ matrix.group }}.toml ${{ matrix.group }}
|
2024-06-14 20:53:40 +00:00
|
|
|
if: false
|
2022-03-17 22:00:10 +00:00
|
|
|
|
|
|
|
- name: Warmup ${{ matrix.group }} group
|
|
|
|
run: |
|
|
|
|
for (( i = 0; i < 3; i++ )) do
|
2022-11-03 09:56:05 +00:00
|
|
|
curl -sS ${{ secrets.ELASTICSEARCH_URL2 }}/latest-$(< VERSION)-group-${{ matrix.group }}/_search | jq -c '.took // .'
|
2022-03-17 22:00:10 +00:00
|
|
|
done
|
2024-06-14 20:53:40 +00:00
|
|
|
if: false
|