Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .aws/test.txt
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
WARN - Dummy AWS credential!
ERROR - HARD-CODED AWS CREDENTIALS
bump commit 1 to trigger gh action

54 changes: 54 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Build Docker Image for Raspberry Pi

on:
push:
branches: [ "main", "env_modernization"]

jobs:
build:
runs-on: ubuntu-latest

steps:
# 1. Pull the codebase into the runner environment
- name: Checkout Code
uses: actions/checkout@v4

# 2. Set up QEMU static binaries to handle cross-platform emulation
- name: Set up QEMU
uses: docker/setup-qemu-action@v4
with:
platforms: arm64,arm

# 3. Spin up a Docker BuildKit container instance
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

# 4. Authenticate to the container registry (GHCR Example)
- name: Log in to GitHub Container Registry
uses: docker/login-action@v4
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

# 5. Extract tag and label information to maintain organized releases
- name: Extract Metadata
id: meta
uses: docker/metadata-action@v6
with:
images: aidanb1409/compostsense_firmware
tags: |
type=raw,value=latest

# 6. Run Buildx execution to build and push the Pi container
- name: Build and Push Image
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: true
platforms: linux/arm64,linux/arm/v7
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
# Leverages GitHub local cache so subsequent runs build instantly
cache-from: type=gha
cache-to: type=gha,mode=max
Loading