-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add workflow to build container from arbitrary repo / ref
Signed-off-by: Julen Landa Alustiza <[email protected]>
- Loading branch information
Showing
1 changed file
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |