-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (56 loc) · 2.29 KB
/
nix.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: "CI build"
on: [push]
jobs:
build:
runs-on: ubuntu-latest-16-cores
permissions:
contents: 'read'
id-token: 'write'
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@v10
- name: Authenticate to Google Cloud Platform
uses: google-github-actions/auth@v2
with:
project_id: yorick-dev-416917
workload_identity_provider: projects/752785843927/locations/global/workloadIdentityPools/github/providers/github-actions-workload-prvdr
service_account: github-actions-service-account@yorick-dev-416917.iam.gserviceaccount.com
- name: Set up cache
uses: zombiezen/[email protected]
with:
substituters: gs://replicate-nix-cache-dev
secret_keys: ${{ secrets.NIX_PRIVATE_KEY }}
use_nixcached: true
nixcached_upload_options: -j12
- name: Get ssh key from secret
env:
GIT_SSH_KEY: ${{ secrets.GIT_SSH_KEY }}
run: |
mkdir -p ~/.ssh
cat > ~/.ssh/id_ed25519 <<< "$GIT_SSH_KEY"
chmod 0600 ~/.ssh/id_ed25519
- name: Build cog-triton-builder
run: nix build --accept-flake-config .#cog-triton-builder -o cog-triton-builder
- name: Build cog-triton-runner-80
run: nix build --accept-flake-config .#cog-triton-runner-80 -o cog-triton-runner-80
- name: Build cog-triton-runner-86
run: nix build --accept-flake-config .#cog-triton-runner-86 -o cog-triton-runner-86
- name: Build cog-triton-runner-90
run: nix build --accept-flake-config .#cog-triton-runner-90 -o cog-triton-runner-90
- run: nix path-info --closure-size --human-readable ./cog-triton-*
- name: Push to replicate
env:
COG_TOKEN: ${{ secrets.COG_TOKEN }}
run: |
echo "::group::Builder"
./cog-triton-builder push r8.im/replicate-internal/cog-triton-ci
echo "::endgroup::"
echo "::group::Runner-80"
./cog-triton-runner-80 push r8.im/replicate-internal/triton-base-sm80
echo "::endgroup::"
echo "::group::Runner-86"
./cog-triton-runner-86 push r8.im/replicate-internal/triton-base-sm86
echo "::endgroup::"
echo "::group::Runner-90"
./cog-triton-runner-90 push r8.im/replicate-internal/triton-base-sm90
echo "::endgroup::"