-
Notifications
You must be signed in to change notification settings - Fork 23
58 lines (50 loc) · 1.44 KB
/
publish-dockerhub.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
name: Publish HABApp distributions to dockerhub
on:
release:
types: [published]
push:
branches:
- master
jobs:
buildx:
runs-on: ubuntu-latest
environment: dockerhub
steps:
- uses: actions/checkout@v4
with:
ref: master
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: all
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
with:
version: latest
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Build and push release
id: docker_build_release
uses: docker/build-push-action@v5
with:
push: true
platforms: linux/amd64,linux/arm64,linux/arm/v7
tags: |
spacemanspiff2007/habapp:latest
spacemanspiff2007/habapp:${{ github.ref_name }}
if: github.ref_type == 'tag'
- name: Build and push latest
id: docker_build_latest
uses: docker/build-push-action@v5
with:
push: true
platforms: linux/amd64,linux/arm64,linux/arm/v7
tags: |
spacemanspiff2007/habapp:master
if: github.ref_type == 'branch'
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}