74 lines
1.9 KiB
YAML
74 lines
1.9 KiB
YAML
name: Nix
|
|
|
|
on:
|
|
push:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- name: Checkout the repository
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Install nix
|
|
uses: cachix/install-nix-action@v27
|
|
|
|
- name: Login to tailscale
|
|
uses: tailscale/github-action@v3.2.3
|
|
with:
|
|
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }}
|
|
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }}
|
|
hostname: github-actions
|
|
tags: tag:ci
|
|
|
|
- name: Setup Attic cache
|
|
uses: ryanccn/attic-action@v0.3.1
|
|
with:
|
|
endpoint: http://wallfacer.curl-boga.ts.net:7080
|
|
cache: main
|
|
token: ${{ secrets.ATTIC_TOKEN }}
|
|
|
|
- name: Check the flake
|
|
run: nix flake check --accept-flake-config
|
|
|
|
|
|
- name: Pre-build the system configuration
|
|
run: nix build --accept-flake-config .
|
|
|
|
- name: Print out the size of /nix/store
|
|
run: du -sh /nix/store
|
|
|
|
- name: Get the init.lua path
|
|
run: |
|
|
init_path=$(grep "init=" result/bin/nixvim-print-init | awk -F'=' '{print $2}')
|
|
cp $init_path init.lua
|
|
|
|
- name: Upload the artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: neovim-configuration
|
|
path: init.lua
|
|
|
|
- name: Publish the init.lua to an orphan github branch
|
|
run: |
|
|
git config --global user.name github-actions
|
|
git config --global user.email github-actions@github.com
|
|
git checkout --orphan init-lua
|
|
git rm -rf .
|
|
git add init.lua
|
|
git commit -m "Publish init.lua"
|
|
git push --force origin init-lua
|
|
|
|
check-formatting:
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- name: Checkout the repository
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Install nix
|
|
uses: cachix/install-nix-action@v16
|
|
|
|
- name: Check formatting (dont update)
|
|
run: nix shell nixpkgs#alejandra -c alejandra -c .
|
|
|