Skip to content

Publish Docker images #65

Publish Docker images

Publish Docker images #65

Workflow file for this run

name: Publish Docker images
on:
workflow_dispatch:
schedule:
- cron: "0 3 * * *"
push:
tags:
- "v*"
paths:
- "**/*"
- "!.github/**" # Important: Exclude PRs related to .github from auto-run
- "!.github/workflows/**" # Important: Exclude PRs related to .github from auto-run
env:
REGISTRY_IMAGE: teslamate/teslamate
permissions:
contents: read
packages: write
jobs:
check_paths:
runs-on: ubuntu-latest
outputs:
githubfolder: ${{ steps.filter.outputs.githubfolder }}
steps:
- uses: actions/checkout@v4
- uses: dorny/[email protected]
id: filter
with:
filters: |
githubfolder:
- '.github/**'
teslamate_build:
needs: check_paths
if: needs.check_paths.outputs.githubfolder == 'false' || github.event_name == 'schedule'
strategy:
fail-fast: false
matrix:
include:
- platform: "linux/amd64"
runs_on: "ubuntu-latest"
cache_id: amd64
- platform: "linux/arm/v7"
runs_on: "buildjet-2vcpu-ubuntu-2204-arm"
cache_id: arm
- platform: "linux/arm64"
runs_on: "buildjet-2vcpu-ubuntu-2204-arm"
cache_id: arm64
runs-on: ${{ matrix.runs_on }}
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Buildx
uses: ./.github/actions/build
with:
is_dockerhub_pushed: "1"
docker_password: ${{ secrets.DOCKER_PASSWORD }}
repository_owner: ${{ github.repository_owner }}
repository: ${{ github.repository }}
github_token: ${{ secrets.GITHUB_TOKEN }}
version: ${{ github.ref_name }}
teslamate_merge:
runs-on: ubuntu-latest
needs:
- check_paths
- teslamate_build
if: needs.check_paths.outputs.githubfolder == 'false' || github.event_name == 'schedule'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/[email protected]
with:
username: teslamate
password: ${{ secrets.DOCKER_PASSWORD }}
- uses: ./.github/actions/merge
with:
image: ${{ env.REGISTRY_IMAGE }}
tags: |
type=schedule,pattern=edge
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=edge
grafana:
needs: check_paths
if: needs.check_paths.outputs.githubfolder == 'false' || github.event_name == 'schedule'
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/[email protected]
with:
username: teslamate
password: ${{ secrets.DOCKER_PASSWORD }}
- uses: ./.github/actions/grafana
with:
tags: |
type=edge
type=schedule,pattern=edge
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}