forked from pleasanthill17/teslamate-abrp
-
Notifications
You must be signed in to change notification settings - Fork 6
76 lines (66 loc) · 2.16 KB
/
buildeux.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
# Build for amd64 and arm64 and publish to DockerHub and GitHub Packages
name: Build and publish Docker image
on:
release:
types:
- 'published'
push:
branches:
- 'main'
tags:
- 'v*'
jobs:
push_to_registries:
name: Push Docker image to multiple registries
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Setup QEMU
uses: docker/setup-qemu-action@v3.0.0
- name: Setup buildx
uses: docker/setup-buildx-action@v3.0.0
- name: Log in to DockerHub
uses: docker/login-action@v3.0.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Log in to the GitHub Packages container registry
uses: docker/login-action@v3.0.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: |
fetzu/teslamate-abrp
ghcr.io/${{ github.repository }}
tags: |
type=semver,pattern={{version}}
- name: Build and push Docker images for releases
if: github.event_name == 'release'
uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: |
${{ steps.meta.outputs.tags }},
fetzu/teslamate-abrp:latest,
ghcr.io/${{ github.repository }}:latest
labels: ${{ steps.meta.outputs.labels }}
- name: Build and push Docker image with 'beta' tag
if: github.ref == 'refs/heads/main'
uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: |
fetzu/teslamate-abrp:beta,
ghcr.io/${{ github.repository }}:beta
labels: ${{ steps.meta.outputs.labels }}