Skip to content

Commit

Permalink
Add workflow to build container from arbitrary repo / ref
Browse files Browse the repository at this point in the history
Signed-off-by: Julen Landa Alustiza <[email protected]>
  • Loading branch information
Zokormazo committed Nov 8, 2022
1 parent a65ef6c commit f5eb6d2
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/build_container_from_ref.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: "Build container from arbitrary repo / ref"
on:
workflow_dispatch:
inputs:
repository:
description: 'The receptor repository to build from.'
required: true
default: 'ansible/receptor'
ref:
description: 'The ref to build. Can be a branch or any other valid ref.'
required: true
default: 'devel'
tag:
description: 'The tag for the container.'
required: true
jobs:
build:
name: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
repository: ${{ github.event.inputs.repository }}
ref: ${{ github.event.inputs.ref }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Install build dependencies
run: |
pip install build
- name: Login To ghcr.io
uses: docker/login-action@v2
with:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io

- name: Build Multiarch Image & Push To Quay
run: |
make container REPO=ghcr.io/${{ github.repository }} TAG=$TAG
env:
CONTAINERCMD: docker buildx
EXTRA_OPTS: --platform linux/amd64,linux/ppc64le,linux/arm64 --push
TAG: ${{ github.event.inputs.tag }}

0 comments on commit f5eb6d2

Please sign in to comment.