-
Notifications
You must be signed in to change notification settings - Fork 16
105 lines (100 loc) · 3.17 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: Nix CI
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
id-token: write
contents: read
concurrency:
group: ${{ github.sha }}
cancel-in-progress: true
env:
AWS_REGION: eu-central-1
AWS_ROLE_ARN: arn:aws:iam::332405224602:role/ci
ECR_REGISTRY: 332405224602.dkr.ecr.eu-central-1.amazonaws.com
S3_CACHE: s3://iog-catalyst-nix?region=eu-central-1
jobs:
discover:
outputs:
hits: ${{ steps.discovery.outputs.hits }}
nix_conf: ${{ steps.discovery.outputs.nix_conf }}
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}
steps:
- name: Standard Discovery
uses: divnix/std-action/[email protected]
id: discovery
build-packages:
needs: discover
strategy:
fail-fast: false
matrix:
target: ${{ fromJSON(needs.discover.outputs.hits).packages.build }}
name: ${{ matrix.target.cell }} - ${{ matrix.target.name }}
runs-on: ubuntu-latest
steps:
- name: Configure AWS Credentials
uses: aws-actions/[email protected]
with:
role-to-assume: ${{ env.AWS_ROLE_ARN }}
aws-region: ${{ env.AWS_REGION }}
- uses: divnix/std-action/[email protected]
with:
extra_nix_config: |
${{ needs.discover.outputs.nix_conf }}
json: ${{ toJSON(matrix.target) }}
nix_key: ${{ secrets.NIX_SIGNING_KEY }}
cache: ${{ env.S3_CACHE }}
build-devshells:
needs: discover
strategy:
fail-fast: false
matrix:
target: ${{ fromJSON(needs.discover.outputs.hits).devshells.build }}
name: ${{ matrix.target.cell }} - ${{ matrix.target.name }}
runs-on: ubuntu-latest
steps:
- name: Configure AWS Credentials
uses: aws-actions/[email protected]
with:
role-to-assume: ${{ env.AWS_ROLE_ARN }}
aws-region: ${{ env.AWS_REGION }}
- uses: divnix/std-action/[email protected]
with:
extra_nix_config: |
${{ needs.discover.outputs.nix_conf }}
json: ${{ toJSON(matrix.target) }}
nix_key: ${{ secrets.NIX_SIGNING_KEY }}
cache: ${{ env.S3_CACHE }}
publish-containers:
if: github.ref == 'refs/heads/main'
needs:
- discover
- build-packages
strategy:
fail-fast: false
matrix:
target: ${{ fromJSON(needs.discover.outputs.hits).containers.publish }}
name: ${{ matrix.target.cell }} - ${{ matrix.target.name }}
runs-on: ubuntu-latest
steps:
- name: Configure AWS Credentials
uses: aws-actions/[email protected]
with:
role-to-assume: ${{ env.AWS_ROLE_ARN }}
aws-region: ${{ env.AWS_REGION }}
- name: Configure Registry
run: |
aws ecr get-login-password --region eu-central-1 | docker login --username AWS --password-stdin "${{ env.ECR_REGISTRY }}"
- uses: divnix/std-action/[email protected]
with:
extra_nix_config: |
${{ needs.discover.outputs.nix_conf }}
json: ${{ toJSON(matrix.target) }}
nix_key: ${{ secrets.NIX_SIGNING_KEY }}
cache: ${{ env.S3_CACHE }}