Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Publish spdk bridge to dockerhub as well #158

Merged
merged 3 commits into from
Feb 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 39 additions & 20 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ on:
pull_request:
branches: [ main ]

env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io

concurrency:
# if workflow for PR or push is already running stop it, and start new one
group: poc-storage-${{ github.ref }}
Expand All @@ -20,33 +16,36 @@ concurrency:
jobs:
storage-push:
runs-on: ubuntu-latest
strategy:
matrix:
package:
- server
- spdk
steps:
- uses: actions/checkout@v3
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@2dd22fa31c04297d369158eb483250f578504a9f
- uses: docker/setup-buildx-action@v2.4.1

- name: Log in to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/#-action@v2.1.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Log into registry ${{ env.REGISTRY }}
- name: Log in to the GH Container registry
if: github.event_name != 'pull_request'
uses: docker/#-action@3da7dc6e2b31f99ef2cb9fb4c50fb0971e0d0139
uses: docker/#-action@v2.1.0
with:
registry: ${{ env.REGISTRY }}
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@766400ca14a75010e7b2e3119aa0d5b46826e8c7
uses: docker/metadata-action@v4.3.0
with:
images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/opi-storage-${{ matrix.package }}
images: |
${{ github.repository }}
ghcr.io/${{ github.repository }}

- name: Build and push Docker image
if: matrix.package != 'spdk'
uses: docker/build-push-action@b651cf69a6590d1ad24c71a10b292b7130202c9b
uses: docker/build-push-action@v4.0.0
with:
context: .
platforms: linux/amd64,linux/arm64
Expand All @@ -56,11 +55,31 @@ jobs:
cache-from: type=gha
cache-to: type=gha,mode=max

spdk-push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2.4.1

- name: Log in to the GH Container registry
if: github.event_name != 'pull_request'
uses: docker/#-action@v2.1.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v4.3.0
with:
images: ghcr.io/${{ github.repository_owner }}/opi-storage-spdk

- name: Build and push Docker image
if: matrix.package == 'spdk'
uses: docker/build-push-action@b651cf69a6590d1ad24c71a10b292b7130202c9b
uses: docker/build-push-action@v4.0.0
with:
context: ${{ matrix.package }}
context: spdk
platforms: linux/amd64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
Expand Down