Skip to content

Commit c3e5e89

Browse files
committed
Update docker-build.yml
1 parent 2ebc660 commit c3e5e89

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

.github/workflows/docker-build.yml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,30 @@ on:
1515
jobs:
1616
build-and-push:
1717
runs-on: ubuntu-latest
18+
permissions:
19+
packages: write
20+
contents: read
1821
steps:
1922
- name: Checkout code
2023
uses: actions/checkout@v4
2124

2225
- name: Set up Docker Buildx
2326
uses: docker/setup-buildx-action@v3
2427

25-
- name: Login to DockerHub
28+
- name: Login to GitHub Container Registry
2629
uses: docker/login-action@v3
2730
with:
28-
username: ${{ secrets.DOCKERHUB_USERNAME }}
29-
password: ${{ secrets.DOCKERHUB_TOKEN }}
31+
registry: ghcr.io
32+
username: ${{ github.actor }}
33+
password: ${{ secrets.GITHUB_TOKEN }}
3034

3135
- name: Extract metadata (tags, labels) for Docker
3236
id: meta
3337
uses: docker/metadata-action@v5
3438
with:
35-
images: lirzh/armhf-mcsm
39+
images: |
40+
ghcr.io/${{ github.repository_owner }}/armhf-mcsm-daemon
41+
ghcr.io/${{ github.repository_owner }}/armhf-mcsm-web
3642
tags: |
3743
type=ref,event=branch
3844
type=ref,event=pr
@@ -47,7 +53,9 @@ jobs:
4753
file: ./daemon.Dockerfile
4854
platforms: linux/arm/v7
4955
push: true
50-
tags: ${{ steps.meta.outputs.tags }},lirzh/armhf-mcsm:daemon
56+
tags: |
57+
ghcr.io/${{ github.repository_owner }}/armhf-mcsm-daemon:latest
58+
${{ steps.meta.outputs.tags }}
5159
labels: ${{ steps.meta.outputs.labels }}
5260

5361
- name: Build and push web image
@@ -57,5 +65,7 @@ jobs:
5765
file: ./web.Dockerfile
5866
platforms: linux/arm/v7
5967
push: true
60-
tags: ${{ steps.meta.outputs.tags }},lirzh/armhf-mcsm:web
68+
tags: |
69+
ghcr.io/${{ github.repository_owner }}/armhf-mcsm-web:latest
70+
${{ steps.meta.outputs.tags }}
6171
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)