Skip to content

Commit f5decba

Browse files
committed
``` feat: Use GHCR for Docker images
- Update Docker workflow to use GHCR registry - Update all environment variables - Fix code style issues ```
1 parent 95e8e7b commit f5decba

File tree

2 files changed

+174
-136
lines changed

2 files changed

+174
-136
lines changed

.github/workflows/docker-publish.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ on:
66
workflow_dispatch:
77

88
env:
9-
REGISTRY: ghcr.io
10-
IMAGE_NAME: ${{ github.repository }}
9+
GHCR_REGISTRY: ghcr.io
10+
GHCR_IMAGE: ghcr.io/${{ github.repository }}
1111

1212
jobs:
1313
build:
@@ -21,12 +21,12 @@ jobs:
2121
- name: Checkout code
2222
uses: actions/checkout@v4
2323
with:
24-
fetch-depth: 1
24+
fetch-depth: 1
2525

2626
- name: Set up QEMU
2727
uses: docker/setup-qemu-action@v3
2828
with:
29-
platforms: 'arm64,amd64'
29+
platforms: "arm64,amd64"
3030

3131
- name: Set up Docker Buildx
3232
uses: docker/setup-buildx-action@v3
@@ -47,15 +47,15 @@ jobs:
4747
- name: Login to registry
4848
uses: docker/login-action@v3
4949
with:
50-
registry: ${{ env.REGISTRY }}
50+
registry: ${{ env.GHCR_REGISTRY }}
5151
username: ${{ github.actor }}
5252
password: ${{ secrets.GITHUB_TOKEN }}
5353

5454
- name: Extract metadata
5555
id: meta
5656
uses: docker/metadata-action@v5
5757
with:
58-
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
58+
images: ${{ env.GHCR_IMAGE }}
5959
tags: |
6060
type=ref,event=branch
6161
type=sha,format=long
@@ -101,9 +101,9 @@ jobs:
101101
- name: Install cosign
102102
uses: sigstore/[email protected]
103103
with:
104-
cosign-release: 'v2.2.2'
104+
cosign-release: "v2.2.2"
105105

106106
- name: Sign image
107107
if: steps.build-and-push.outputs.digest != ''
108108
run: |
109-
echo "${{ steps.meta.outputs.tags }}" | xargs -I {} cosign sign --yes "{}@${{ steps.build-and-push.outputs.digest }}"
109+
echo "${{ steps.meta.outputs.tags }}" | xargs -I {} cosign sign --yes "{}@${{ steps.build-and-push.outputs.digest }}"

0 commit comments

Comments
 (0)