Skip to content

Build container image #40

Build container image

Build container image #40

Workflow file for this run

name: Build container image
on:
release:
types: [prereleased]
permissions:
contents: read
packages: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Set up QEMU
uses: docker/setup-qemu-action@v3.0.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.2.0
- name: Login to GitHub Container Registry
uses: docker/login-action@v3.1.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Log in to docker hub
uses: docker/login-action@v3.1.0
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v5.3.0
with:
file: ./Dockerfile
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6
cache-from: type=gha
cache-to: type=gha,mode=max
push: true
build-args: |
BUILDKIT_CONTEXT_KEEP_GIT_DIR=true
tags: |
ghcr.io/${{ github.repository_owner }}/${{ github.repository }}:latest
ghcr.io/${{ github.repository_owner }}/${{ github.repository }}:${{ github.sha }}
docker.io/iainbullock/tesla_ble_mqtt:dev
docker.io/iainbullock/tesla_ble_mqtt:${{ github.ref_name }}