Skip to content

Push image.

Push image. #56

Workflow file for this run

name: CI
on:
push:
branches:
- '*'
tags:
- 'v*'
pull_request:
env:
CARGO_INCREMENTAL: 0
jobs:
tests:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Install Nix
uses: cachix/install-nix-action@v27
with:
nix_path: nixpkgs=channel:nixos-24.11
-
name: Cargo cache
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
interface/target/
key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock') }}
-
name: Run tests
run: nix-shell --command "make test"
dist:
needs: tests
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Install Nix
uses: cachix/install-nix-action@v27
with:
nix_path: nixpkgs=channel:nixos-24.11
-
name: Cargo cache
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
interface/target/
key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock') }}
-
name: Install dev dependencies
run: nix-shell --command "make dev-dependencies"
-
name: Build
run: nix-shell --command "make build"
-
name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
chirpstack/${{ github.event.repository.name }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}
type=semver,pattern={{major}}.{{minor}}
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
id: docker_build
uses: docker/build-push-action@v6
with:
context: .
push: github.event_name != 'pull_request'
platforms: linux/amd64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
-
name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}