aux-search/.forgejo/workflows/import-to-elasticsearch.yml
Christoph Heiss e5c37d1c8b
Some checks failed
Build flake-info / build-flake-info (push) Failing after 1s
Frontend: Build & Deploy to Netlify / build-and-deploy (push) Failing after 1m34s
ci: try to mostly adapt workflows
Signed-off-by: Christoph Heiss <christoph@c8h4.io>
2024-06-14 22:53:40 +02:00

98 lines
2.6 KiB
YAML

name: "Hourly import to Elasticsearch"
on:
workflow_dispatch:
schedule:
- cron: '0 * * * *'
permissions:
contents: read
issues: write
jobs:
nixos-channels:
runs-on: nixos-unstable
outputs:
matrix: ${{ steps.nixos-channels.outputs.matrix }}
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: NixOS Channels
id: nixos-channels
run: |
nix build --accept-flake-config -L .#nixosChannels
channels="{\"channel\": $(< ./result)}"
echo "$channels"
echo "matrix=$channels" >> "$GITHUB_OUTPUT"
import-nixpkgs:
needs: nixos-channels
runs-on: nixos-unstable
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.nixos-channels.outputs.matrix) }}
env:
RUST_LOG: debug
FI_ES_EXISTS_STRATEGY: abort
FI_ES_URL: ${{ secrets.ELASTICSEARCH_URL2 }}
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: Import ${{ matrix.channel }} channel
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
nix run --accept-flake-config .#flake-info -- --push --elastic-schema-version=$(< VERSION) nixpkgs ${{ matrix.channel }}
if: false
- name: Warmup ${{ matrix.channel }} channel
run: |
for (( i = 0; i < 3; i++ )) do
curl -sS ${{ secrets.ELASTICSEARCH_URL2 }}/latest-$(< VERSION)-nixos-${{ matrix.channel }}/_search | jq -c '.took // .'
done
if: false
import-flakes:
runs-on: nixos-unstable
strategy:
fail-fast: false
matrix:
group:
- manual
env:
RUST_LOG: debug
FI_ES_EXISTS_STRATEGY: recreate
FI_ES_URL: ${{ secrets.ELASTICSEARCH_URL2 }}
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: Import ${{ matrix.group }} group
run: |
nix run --accept-flake-config .#flake-info -- --push --elastic-schema-version=$(< ./VERSION) group ./flakes/${{ matrix.group }}.toml ${{ matrix.group }}
if: false
- name: Warmup ${{ matrix.group }} group
run: |
for (( i = 0; i < 3; i++ )) do
curl -sS ${{ secrets.ELASTICSEARCH_URL2 }}/latest-$(< VERSION)-group-${{ matrix.group }}/_search | jq -c '.took // .'
done
if: false