Skip to content

Commit

Permalink
workflows/podvm: configurable registry
Browse files Browse the repository at this point in the history
Added the `registry` parameter to the builder/binaries/podvm workflows
to allow publish the images in an arbitrary registry. Also added login
handler if the registry is `ghcr.io`.

Signed-off-by: Wainer dos Santos Moschetta <[email protected]>
  • Loading branch information
wainersm committed Nov 15, 2023
1 parent 88e2272 commit a281187
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/podvm.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: Create Pod VM Image
on:
workflow_call:
inputs:
registry:
default: 'quay.io/confidential-containers'
required: false
type: string

jobs:
build:
Expand Down Expand Up @@ -31,15 +36,25 @@ jobs:

- name: Login to Quay container Registry
uses: docker/login-action@v2
if: ${{ startsWith(inputs.registry, 'quay.io') }}
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}

- name: Login to Github Container Registry
if: ${{ startsWith(inputs.registry, 'ghcr.io') }}
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
run: make podvm-image
env:
PUSH: true
REGISTRY: ${{ inputs.registry }}
ARCH: ${{ matrix.arch }}
PODVM_DISTRO: ${{ matrix.os }}
CLOUD_PROVIDER: ${{ matrix.provider }}
15 changes: 15 additions & 0 deletions .github/workflows/podvm_binaries.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: Create Pod VM Binaries Image
on:
workflow_call:
inputs:
registry:
default: 'quay.io/confidential-containers'
required: false
type: string

jobs:
build:
Expand Down Expand Up @@ -32,15 +37,25 @@ jobs:
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Login to Quay container Registry
if: ${{ startsWith(inputs.registry, 'quay.io') }}
uses: docker/login-action@v2
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}

- name: Login to Github Container Registry
if: ${{ startsWith(inputs.registry, 'ghcr.io') }}
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
run: make podvm-binaries
env:
PUSH: true
REGISTRY: ${{ inputs.registry }}
ARCH: ${{ matrix.arch }}
PODVM_DISTRO: ${{ matrix.os }}
15 changes: 15 additions & 0 deletions .github/workflows/podvm_builder.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: Create Pod VM Builder Image
on:
workflow_call:
inputs:
registry:
default: 'quay.io/confidential-containers'
required: false
type: string

jobs:
build:
Expand Down Expand Up @@ -30,14 +35,24 @@ jobs:
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Login to Quay container Registry
if: ${{ startsWith(inputs.registry, 'quay.io') }}
uses: docker/login-action@v2
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}

- name: Login to Github Container Registry
if: ${{ startsWith(inputs.registry, 'ghcr.io') }}
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
run: make podvm-builder
env:
PUSH: true
REGISTRY: ${{ inputs.registry }}
PODVM_DISTRO: ${{ matrix.os }}

0 comments on commit a281187

Please sign in to comment.