Skip to content

nix:deploy

nix:deploy #1

Workflow file for this run

name: nix:deploy
on:
push:
branches:
- main
tags:
- 'v*'
jobs:
binary:
name: deploy::binary
runs-on: ubuntu-latest
steps:
- name: Checkout πŸ›ŽοΈ
uses: actions/checkout@v3
- name: Install Nix ❄
uses: DeterminateSystems/nix-installer-action@v4
- name: Link Cachix πŸ”Œ
uses: cachix/cachix-action@v12
with:
name: '${{ vars.CACHIX_CACHE_NAME }}'
authToken: '${{ secrets.CACHIX_CACHE_AUTH_TOKEN }}'
- name: Login to GitHub Container Registry πŸ“¦
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: build the crate using nix πŸ”¨
run: nix build --print-build-logs
- name: Create release πŸš€
uses: actions/upload-artifact@v3
with:
name: mongodb-connector
path: result/bin/mongodb-connector
docker:
name: deploy::docker
needs: binary
runs-on: ubuntu-latest
steps:
- name: Checkout πŸ›ŽοΈ
uses: actions/checkout@v3
- name: Install Nix ❄
uses: DeterminateSystems/nix-installer-action@v4
- name: Link Cachix πŸ”Œ
uses: cachix/cachix-action@v12
with:
name: '${{ vars.CACHIX_CACHE_NAME }}'
authToken: '${{ secrets.CACHIX_CACHE_AUTH_TOKEN }}'
- name: Login to GitHub Container Registry πŸ“¦
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Deploy πŸš€
run: nix run .#publish-docker-image ${{ github.ref }}