Skip to content

improve error checks and messages #27

improve error checks and messages

improve error checks and messages #27

Workflow file for this run

name: Build Firmware
on:
push:
branches:
- "*"
tags:
- "v*"
env:
REPO: ghcr.io/elcritch/nesper
jobs:
build: !test
runs-on: ubuntu-22.04
steps:
- name: Env
run: env
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
# Extract metadata (tags, labels) for Docker
- name: Set Tag
run: |
VERSION=$(cat esp32_sensor_router.nimble | grep version | awk '{print $3}' | tr -d '"')
DATE=$(date --iso-8601)
RTAG=$(cat .git/HEAD | tr '/' ' ' | cut -d ' ' -f 4)
ITAG=$REPO:$RTAG-$DATE
ITAG=$ITAG,$REPO:version-$VERSION
ITAG=$ITAG,$REPO:ref-$GITHUB_SHA
echo "ITAG=$ITAG" >> $GITHUB_ENV
# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v4
with:
context: .
file: .devcontainer/Dockerfile.build
push: false
platforms: linux/amd64
tags: ${{ env.ITAG }}
secrets: |
GIT_AUTH_TOKEN=${{ secrets.GITHUB_TOKEN }}