Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Add workflow to build container from arbitrary repo / ref #686

Open
wants to merge 2 commits into
base: devel
Choose a base branch
from
Open
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
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 }}