Make the original ESP_IDF_VERSION available, fix event loop legacy an… #32
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 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 }} |