-
Notifications
You must be signed in to change notification settings - Fork 750
114 lines (102 loc) · 3.35 KB
/
buildx.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
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@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
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@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- 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@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Login to Docker Hub
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
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@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Login to Docker Hub
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
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}}