From 67773e9204de19a5a40166ba15be425b4c8624b6 Mon Sep 17 00:00:00 2001 From: Fabian Hauser Date: Sat, 28 Sep 2024 22:38:09 +0300 Subject: [PATCH] Add initial action --- action.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 action.yml diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..628bd6c --- /dev/null +++ b/action.yml @@ -0,0 +1,20 @@ +name: 'Initialize CI Environment and Repository' +description: 'Initialize a CI environment with nix (and also checkout the repository recursively with LFS)' +runs: + using: "composite" + steps: + - name: Setup NIX CI Environment + run: | + echo "substituters = https://nixpkgs-cache.qo.is?priority=39" >> /etc/nix/nix.conf + echo "trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" >> /etc/nix/nix.conf + nix profile install nixpkgs#git-lfs nixpkgs#gnused + mkdir -p ~/.config/nix && cp /etc/nix/nix.conf ~/.config/nix/ + + - name: Checkout Repository + shell: "nix shell nixpkgs#git-lfs nixpkgs#gnused --command {0}" + run: | + git lfs install + git config --global credential.helper store + AUTH_URL=`echo -n "$GITHUB_SERVER_URL" | sed "s%https://%https://oauth2:$GITHUB_TOKEN@%"` + # Disable clone protection to pull LFS as well + GIT_CLONE_PROTECTION_ACTIVE=false git clone --branch $GITHUB_REF_NAME --recurse-submodules $AUTH_URL/$GITHUB_REPOSITORY .