Skip to content

Commit e2e8c09

Browse files
committed
add gh action to push to docker hub
1 parent 7e489d4 commit e2e8c09

File tree

2 files changed

+67
-0
lines changed

2 files changed

+67
-0
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
6+
# GitHub recommends pinning actions to a commit SHA.
7+
# To get a newer version, you will need to update the SHA.
8+
# You can also reference a tag or branch, but the action may change without warning.
9+
10+
name: Publish Docker image
11+
12+
on:
13+
release:
14+
types: [published]
15+
workflow_dispatch: {}
16+
17+
# Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds.
18+
env:
19+
REGISTRY: docker.io
20+
IMAGE_NAME: docbobo/roon-extension-denon
21+
22+
jobs:
23+
push_to_registry:
24+
name: Push Docker image to Docker Hub
25+
runs-on: ubuntu-latest
26+
strategy:
27+
matrix:
28+
platform: [linux/amd64, linux/arm64, linux/arm]
29+
30+
environment: production
31+
permissions:
32+
packages: write
33+
contents: read
34+
attestations: write
35+
id-token: write
36+
steps:
37+
- name: Check out the repo
38+
uses: actions/checkout@v4
39+
40+
- name: Log in to Docker Hub
41+
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
42+
with:
43+
username: ${{ secrets.DOCKER_USERNAME }}
44+
password: ${{ secrets.DOCKER_PASSWORD }}
45+
46+
- name: Extract metadata (tags, labels) for Docker
47+
id: meta
48+
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
49+
with:
50+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
51+
52+
- name: Build and push Docker image
53+
id: push
54+
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
55+
with:
56+
context: .
57+
file: ./Dockerfile
58+
push: true
59+
tags: ${{ steps.meta.outputs.tags }}
60+
labels: ${{ steps.meta.outputs.labels }}
61+
62+
- name: Generate artifact attestation
63+
uses: actions/attest-build-provenance@v2
64+
with:
65+
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
66+
subject-digest: ${{ steps.push.outputs.digest }}
67+
push-to-registry: true

roon-tui.log

Whitespace-only changes.

0 commit comments

Comments
 (0)