Skip to content

Commit

Permalink
Add GitHub action to build arm version of JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
philhawthorne committed Nov 27, 2023
1 parent 7718498 commit 7a78d2e
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Docker Build/Publish Image
on:
push:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-18.04
env:
DOCKER_REGISTRY: hub.docker.com
DOCKER_IMAGE: philhawthorne/ha-dockermon:json-arm
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_TARGET_PLATFORM: linux/arm/v7
steps:
- name: Checkout the code
uses: actions/checkout@v1
- name: Set up Docker Buildx
uses: crazy-max/ghaction-docker-buildx@v1
with:
version: latest
- name: Prepare
if: success()
id: prepare
run: |
echo ::set-output name=docker_platform::${DOCKER_TARGET_PLATFORM}
echo ::set-output name=docker_image::${DOCKER_REGISTRY}/${DOCKER_IMAGE}
echo ::set-output name=version::${GITHUB_RUN_NUMBER}
- name: Docker Login
if: success()
run: |
echo "${DOCKER_PASSWORD}" | docker login ${DOCKER_REGISTRY} --username "${DOCKER_USERNAME}" --password-stdin
- name: Run Buildx (push image)
if: success()
run: |
docker buildx build \ --platform ${{ steps.prepare.outputs.docker_platform }} \ --tag ${{ steps.prepare.outputs.docker_image }}:${{ steps.prepare.outputs.version }} \ --file ./Dockerfile.RaspberryPi \ --output type=image,push=true .

0 comments on commit 7a78d2e

Please sign in to comment.