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 c10c47f
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/build_container_from_ref.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
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 ghcr.io
run: |
REPO=$(echo $REPO | tr '[A-Z]' '[a-z]')
make container REPO=$REPO TAG=$TAG
env:
CONTAINERCMD: docker buildx
EXTRA_OPTS: --platform linux/amd64,linux/ppc64le,linux/arm64 --push
TAG: ${{ github.event.inputs.tag }}
REPO: ghcr.io/${{ github.repository }}

0 comments on commit c10c47f

Please sign in to comment.