Skip to content

Merge pull request #39 from hasura/djh/auto-bump-nix #36

Merge pull request #39 from hasura/djh/auto-bump-nix

Merge pull request #39 from hasura/djh/auto-bump-nix #36

Workflow file for this run

name: SQLServer NDC build and deploy with Nix
on:
push:
branches:
- main
tags:
- 'v*'
jobs:
binary:
name: deploy::binary
runs-on: ubuntu-latest
steps:
- name: Checkout πŸ›ŽοΈ
uses: actions/checkout@v4
- name: Install Nix ❄
uses: DeterminateSystems/nix-installer-action@v6
- name: Run the Magic Nix Cache πŸ”Œ
uses: DeterminateSystems/magic-nix-cache-action@v2
- name: Login to GitHub Container Registry πŸ“¦
uses: docker/login-action@v3
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: hasura-sqlserver-agent-rs
path: result/bin/ndc-sqlserver
# scream into Slack if something goes wrong
- name: Report Status
if: always()
uses: ravsamhq/notify-slack-action@v2
with:
status: ${{ job.status }}
notify_when: failure
notification_title: '😧 Error on <{repo_url}|{repo}>'
message_format: '🐴 *{workflow}* {status_message} for <{repo_url}|{repo}>'
env:
SLACK_WEBHOOK_URL: ${{ secrets.BROKEN_BUILD_SLACK_WEBHOOK_URL }}
docker:
name: deploy::docker
needs: binary
runs-on: ubuntu-latest
steps:
- name: Checkout πŸ›ŽοΈ
uses: actions/checkout@v4
- name: Install Nix ❄
uses: DeterminateSystems/nix-installer-action@v6
- name: Run the Magic Nix Cache πŸ”Œ
uses: DeterminateSystems/magic-nix-cache-action@v2
- name: Login to GitHub Container Registry πŸ“¦
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Deploy πŸš€
run: nix run .#publish-docker-image ${{ github.ref }}
# scream into Slack if something goes wrong
- name: Report Status
if: always()
uses: ravsamhq/notify-slack-action@v2
with:
status: ${{ job.status }}
notify_when: failure
notification_title: '😧 Error on <{repo_url}|{repo}>'
message_format: '🐴 *{workflow}* {status_message} for <{repo_url}|{repo}>'
env:
SLACK_WEBHOOK_URL: ${{ secrets.BROKEN_BUILD_SLACK_WEBHOOK_URL }}