surrealpatch/.github/workflows/nix.yml

46 lines
1.2 KiB
YAML
Raw Normal View History

name: Nix
on:
push:
branches:
- main
pull_request:
types: [ labeled ]
# Setting the shell option, it will run 'bash --noprofile --norc -eo pipefail {0}'
defaults:
run:
shell: bash
jobs:
build-docker:
name: Build Docker image
2023-07-25 21:36:31 +00:00
if: ${{ github.ref == 'refs/heads/main' }} || ${{ github.event.label.name == 'nix' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
2023-03-08 10:41:34 +00:00
- uses: cachix/install-nix-action@v20
- uses: cachix/cachix-action@v12
with:
name: surrealdb
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
extraPullNames: nix-community
- run: nix build .#docker-image
- run: docker load --input ./result
build-native-linux:
name: Build native Linux binary
2023-07-25 21:36:31 +00:00
if: ${{ github.ref == 'refs/heads/main' }} || ${{ github.event.label.name == 'nix' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
2023-03-08 10:41:34 +00:00
- uses: cachix/install-nix-action@v20
- uses: cachix/cachix-action@v12
with:
name: surrealdb
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
extraPullNames: nix-community
- run: nix build .#x86_64-unknown-linux-gnu
- run: ./result/bin/surreal help