Skip to content

Commit 9d6e90e

Browse files
committed
Adding workflow for docker publishing
1 parent 4d8230a commit 9d6e90e

1 file changed

Lines changed: 50 additions & 0 deletions

File tree

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Publish Docker Image - Ubuntu
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
tags:
8+
- "v*.*.*"
9+
workflow_dispatch:
10+
11+
jobs:
12+
build-and-push:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Docker meta
16+
id: meta
17+
uses: docker/metadata-action@v5
18+
with:
19+
# list of Docker images to use as base name for tags
20+
images: |
21+
tagyoureit/njspc-dashpanel
22+
# generate Docker tags based on the following events/attributes
23+
tags: |
24+
type=schedule
25+
type=ref,event=branch
26+
type=ref,event=pr
27+
type=semver,pattern={{version}}
28+
type=semver,pattern={{major}}.{{minor}}
29+
type=semver,pattern={{major}}
30+
type=sha
31+
32+
- name: Set up QEMU
33+
uses: docker/setup-qemu-action@v3
34+
35+
- name: Set up Docker Buildx
36+
uses: docker/setup-buildx-action@v3
37+
38+
- name: Login to Docker Hub
39+
uses: docker/login-action@v3
40+
with:
41+
username: ${{ secrets.DOCKERHUB_USERNAME }}
42+
password: ${{ secrets.DOCKERHUB_TOKEN }}
43+
44+
- name: Build and push combined Docker image
45+
uses: docker/build-push-action@v6
46+
with:
47+
push: true
48+
platforms: linux/amd64,linux/arm64,linux/arm/v7
49+
tags: ${{ steps.meta.outputs.tags }}
50+
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)