Skip to content

Build Docker Image

Build Docker Image #75

Workflow file for this run

name: Build Docker Image
on:
workflow_dispatch:
inputs:
version:
description: Specify a custom version
required: false
default: ''
schedule:
- cron: "0 20 * * *"
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
version: [stable, latest, '', dev]
steps:
- name: Determine version
id: version_tag
run: |
ver="${{ matrix.version }}"
[ -z "$ver" ] && ver="${{ github.event.inputs.version }}"
[ -z "$ver" ] && ver="$(date +%Y).$(date +%-m)"
echo "VERSION=$ver" >> $GITHUB_ENV
echo "VERSION=$ver"
- name: Checkout code
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.HACN_USERNAME }}
password: ${{ secrets.HACN_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
${{ secrets.HACN_USERNAME }}/hacn:${{ env.VERSION }}
build-args: |
VERSION=${{ env.VERSION }}
platforms: linux/amd64,linux/arm64,linux/arm/v7
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
${{ secrets.DOCKER_USERNAME }}/hacs:${{ env.VERSION }}
build-args: |
VERSION=${{ env.VERSION }}
platforms: linux/amd64,linux/arm64,linux/arm/v7