Skip to content

Deploy

Deploy #566

Workflow file for this run

name: Deploy
on:
workflow_run:
workflows:
- Nix
branches:
- main
types:
- completed
workflow_dispatch:
concurrency: deploy
jobs:
deploy:
name: Build and Deploy
runs-on: ubuntu-latest
steps:
# TODO: re-eval once easimon/maximize-build-space#20 is fixed and merged
- uses: easimon/maximize-build-space@v10
#- uses: thiagokokada/maximize-build-space@remove-large-packages
with:
build-mount-path: '/nix'
remove-dotnet: 'true'
remove-android: 'true'
remove-haskell: 'true'
remove-codeql: 'true'
remove-docker-images: 'true'
#remove-large-packages: 'true'
- uses: cachix/install-nix-action@v25
with:
extra_nix_config: |
system-features = benchmark big-parallel kvm nixos-test
- uses: cachix/cachix-action@v14
with:
name: foosteros
- uses: actions/checkout@v4
- id: build
name: Build hosts
run: |
nix -vL --show-trace build .#deploy
echo "spec=$(nix -vL --show-trace eval --raw .#deploy)" >> $GITHUB_OUTPUT
- name: Deploy hosts
env:
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
CACHIX_ACTIVATE_TOKEN: ${{ secrets.CACHIX_ACTIVATE_TOKEN }}
SPEC: ${{ steps.build.outputs.spec }}
run: |
cachix push foosteros "$SPEC"
cachix deploy activate "$SPEC"