diff --git a/.aws/test.txt b/.aws/test.txt index 849082b..1450e19 100644 --- a/.aws/test.txt +++ b/.aws/test.txt @@ -1 +1,3 @@ -WARN - Dummy AWS credential! +ERROR - HARD-CODED AWS CREDENTIALS +bump commit 1 to trigger gh action + diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 0000000..3f0042c --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -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