Skip to content

Create pi4-setup.sh #41

Create pi4-setup.sh

Create pi4-setup.sh #41

Workflow file for this run

name: Container Processing
on:
push:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Get tag
id: get_tag
run: |
echo "::set-output name=IMAGE_TAG::$(echo $GITHUB_REF | cut -d / -f 3)"
- name: Set up qemu
uses: docker/setup-qemu-action@v3
with:
platforms: all
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
with:
version: latest
- name: Docker Login
run: echo "${{ secrets.DOCKER_TOKEN }}" | docker login --username "${{ secrets.DOCKER_USERNAME }}" --password-stdin
- name: Get Changes
id: identify
uses: jitterbit/get-changed-files@v1
- run: |
echo ${{ steps.files.output.all }}
- name: Build Images
env:
# Every folder in the repo that has a Dockerfile within it, comma separated
DOCKERFOLDERS: "core,mqtt,ca"
DOCKERNAMESPACE: ${{ secrets.DOCKER_NAMESPACE }}
PROJECT_NAME: "edgetech"
run: |
IFS=","
read -ra ARR <<< "$DOCKERFOLDERS"
for folder in "${ARR[@]}"
do
IFS="/"
read -ra NAMEFOLDER <<< $folder
SUBNAME=${NAMEFOLDER[0]}
PUBLISHNAME=""
if [ $NAMEFOLDER != $SUBNAME ]; then
PUBLISHNAME=$PROJECT_NAME-$folder-$SUBNAME
else
PUBLISHNAME=$PROJECT_NAME-$folder
fi
echo "Building $folder"
docker buildx build "$folder" --push \
--tag $DOCKERNAMESPACE/$PUBLISHNAME:latest \
--tag $DOCKERNAMESPACE/$PUBLISHNAME:${{ steps.get_tag.outputs.IMAGE_TAG }} \
--platform linux/arm64,linux/amd64
done