Skip to content

Commit 6e6d17b

Browse files
authored
Update docker.yml
1 parent a444347 commit 6e6d17b

1 file changed

Lines changed: 17 additions & 27 deletions

File tree

.github/workflows/docker.yml

Lines changed: 17 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,52 @@
1-
name: Build and Push to GHCR & Docker Hub
1+
name: Build and Push to Docker Hub
22

33
on:
44
push:
55
branches: [ main, master ]
66
tags: [ 'v*.*.*' ]
77
pull_request:
88
branches: [ main, master ]
9+
workflow_dispatch:
910

1011
jobs:
1112
build-and-push:
1213
runs-on: ubuntu-latest
13-
permissions:
14-
contents: read
15-
packages: write # Needed for GHCR
16-
14+
1715
steps:
1816
- name: Checkout repository
1917
uses: actions/checkout@v4
20-
18+
2119
- name: Set up Docker Buildx
2220
uses: docker/setup-buildx-action@v3
23-
24-
# Login to GHCR (using GITHUB_TOKEN)
25-
- name: Login to GHCR
26-
if: github.event_name != 'pull_request'
27-
uses: docker/login-action@v3
28-
with:
29-
registry: ghcr.io
30-
username: ${{ github.actor }}
31-
password: ${{ secrets.GITHUB_TOKEN }}
32-
33-
# Login to Docker Hub (add your secrets first!)
21+
22+
# Login to Docker Hub
3423
- name: Login to Docker Hub
3524
if: github.event_name != 'pull_request'
3625
uses: docker/login-action@v3
3726
with:
38-
username: ${{ secrets.DOCKERHUB_USERNAME }}
27+
username: 1minds3t
3928
password: ${{ secrets.DOCKERHUB_TOKEN }}
40-
41-
# Extract metadata/tags for BOTH registries
29+
30+
# Extract metadata/tags
4231
- name: Extract metadata (tags, labels)
4332
id: meta
4433
uses: docker/metadata-action@v5
4534
with:
46-
images: |
47-
ghcr.io/${{ github.repository }}
48-
1minds3t/omnipkg # Your Docker Hub repo
35+
images: 1minds3t/omnipkg
4936
tags: |
5037
type=ref,event=branch
5138
type=ref,event=pr
5239
type=semver,pattern={{version}}
40+
type=semver,pattern={{major}}.{{minor}}
41+
type=raw,value=latest,enable={{is_default_branch}}
5342
type=sha
54-
55-
# Build and push to both
56-
- name: Build and push
57-
uses: docker/build-push-action@v6
43+
44+
# Build and push
45+
- name: Build and push to Docker Hub
46+
uses: docker/build-push-action@v5
5847
with:
5948
context: .
49+
platforms: linux/amd64,linux/arm64
6050
push: ${{ github.event_name != 'pull_request' }}
6151
tags: ${{ steps.meta.outputs.tags }}
6252
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)