Skip to content

Build Docker image dev and dev_shelly_alpine with buildx #319

Build Docker image dev and dev_shelly_alpine with buildx

Build Docker image dev and dev_shelly_alpine with buildx #319

name: Build dev and Push Docker image dev, dev_alpine and dev_shelly_alpine to Docker Hub with buildx
on:
push:
branches:
- dev
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: all
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
version: latest
- name: Extract version from package.json
id: extract_version
run: |
VERSION=$(jq -r '.version' package.json)
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Echo main version ${{ env.VERSION }}
run: |
echo "Extracted version is: $VERSION ${{ env.VERSION }}"
- name: Run Docker Buildx on dev_shelly_alpine
run: |
docker buildx build \
--platform linux/arm64 \
-f docker/Dockerfile.shelly.alpine \
-t luligu/matterbridge:dev_shelly_alpine \
--push .
docker manifest inspect luligu/matterbridge:dev_shelly_alpine
timeout-minutes: 60
- name: Run Docker Buildx on dev_alpine
run: |
docker buildx build \
--platform linux/amd64,linux/arm64,linux/arm/v7 \
-f docker/Dockerfile.alpine \
-t luligu/matterbridge:dev_alpine \
--push .
docker manifest inspect luligu/matterbridge:dev_alpine
timeout-minutes: 60
- name: Run Docker Buildx on dev
run: |
docker buildx build \
--platform linux/amd64,linux/arm64,linux/arm/v7 \
-f docker/Dockerfile.dev \
-t luligu/matterbridge:dev \
--push .
docker manifest inspect luligu/matterbridge:dev
timeout-minutes: 60