generated from srid/rib-sample
-
-
Notifications
You must be signed in to change notification settings - Fork 145
39 lines (39 loc) · 1.33 KB
/
ci.yaml
File metadata and controls
39 lines (39 loc) · 1.33 KB
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
name: "CI"
on:
pull_request:
push:
branches: [master]
concurrency:
group: ci-${{ github.event_name }}-${{ github.ref }}
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v31
with:
extra_nix_config: |
experimental-features = nix-command flakes
- uses: cachix/cachix-action@v16
with:
name: srid
signingKey: "${{ secrets.CACHIX_SIGNING_KEY }}"
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- name: Build 🔧
run: nix build -j4
- name: Retrieve neuron version
run: |
echo "NEURONVER=$(./result/bin/neuron --version)" >> $GITHUB_ENV
- name: Publish Docker image to Docker Hub
if: ${{ github.ref == 'refs/heads/master' && runner.os == 'Linux' }}
run: |
docker load -i $(nix build .#dockerImage --print-out-paths)
docker tag "sridca/neuron:dev" "sridca/neuron:latest"
docker tag "sridca/neuron:dev" "sridca/neuron:${{ env.NEURONVER }}"
echo ${{ secrets.DOCKER_PASS }} | docker login -u sridca --password-stdin
set -x
docker push "sridca/neuron:latest"
docker push "sridca/neuron:${{ env.NEURONVER }}"