Add sensor configuration #11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: push | |
jobs: | |
build-test: | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4.1.7 | |
- name: Install protoc | |
run: sudo apt-get install protobuf-compiler | |
- name: Launch Database for testing | |
run: docker compose up postgres --detach | |
- name: Test | |
env: | |
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/ganymede | |
run: cargo test | |
build-docker: | |
runs-on: ubuntu-24.04 | |
needs: build-test | |
steps: | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3.3.0 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Checkout | |
uses: actions/checkout@v4.1.7 | |
- name: Build image | |
run: docker build . -t ganymede | |
- name: Push latest (from develop) | |
if: ${{ github.ref == 'refs/heads/develop' }} | |
run: | | |
docker tag ganymede ghcr.io/ngc7293/ganymede:latest | |
docker push ghcr.io/ngc7293/ganymede:latest | |
- name: Push stable (from main) | |
if: ${{ github.ref == 'refs/heads/main' }} | |
run: | | |
docker tag ganymede ghcr.io/ngc7293/ganymede:stable | |
docker push ghcr.io/ngc7293/ganymede:stable |