nixos-t2/.github/workflows/CI.yml
kekrby bcfa84572f CI: allow only one build to take place at a time
This will prevent the CI from building the same packages twice when a
build gets triggered while there are other ongoing builds.
2022-10-02 18:07:36 +03:00

38 lines
1,000 B
YAML

name: CI
on:
push:
paths-ignore:
- "**.md"
pull_request:
paths-ignore:
- "**.md"
jobs:
CI:
runs-on: ubuntu-latest
concurrency:
group: CI
steps:
- name: Checkout
uses: actions/checkout@v3
- name: "Install Nix"
uses: cachix/install-nix-action@v17
- name: "Set Up Binary Cache"
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
uses: cachix/cachix-action@v10
with:
name: t2linux
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
pushFilter: "x86_64-linux.iso$"
- name: Build
run: |
for iso in $(nix flake show --json | nix run nixpkgs#jq -- -r keys[]); do
nix build .#$iso
split -d result/iso/*.iso -b 1G $iso.iso-part-
rm result
done
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/v') && contains(github.ref, '.')
with:
files: "*.iso-part-*"