Skip to content

Fix for docker image tag in GitHub actions #6

Fix for docker image tag in GitHub actions

Fix for docker image tag in GitHub actions #6

Workflow file for this run

name: Docker Build/Publish Image
on:
push:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
env:
DOCKER_REGISTRY: hub.docker.com
DOCKER_IMAGE: philhawthorne/ha-dockermon
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 --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 }}:json-arm --file ./Dockerfile.RaspberryPi --output type=image,push=true .