Skip to content

Commit

Permalink
push to ghcr.io registry
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoqiangwang committed Mar 20, 2024
1 parent 9829823 commit 16b521c
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/build_docker_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ on:
branches:
- "*"

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build:
name: build ((${{ matrix.platform}})
Expand All @@ -29,13 +33,18 @@ jobs:
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Github packages
- name: Login to the container registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
Expand All @@ -44,4 +53,5 @@ jobs:
push: ${{ github.event_name != 'pull_request' }}
build-args: |
ARCH=${{ matrix.platform }}
tags: ${{ github.repository }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit 16b521c

Please sign in to comment.