multiarch-build-workflow/.gitea/workflows/build.yaml

62 lines
1.7 KiB
YAML
Raw Normal View History

2023-12-13 08:54:30 +00:00
name: "Multiarch Build Action"
on:
workflow_call:
inputs:
archs:
required: true
type: string
default: "arm64, amd64"
repository:
required: true
type: string
2023-12-14 08:53:54 +00:00
default: ${{ gitea.repository }}
2023-12-13 08:54:30 +00:00
ref_name:
required: true
type: string
2023-12-14 08:53:54 +00:00
default: ${{ gitea.ref_name }}
2023-12-13 08:54:30 +00:00
sha:
required: true
type: string
2023-12-14 08:53:54 +00:00
default: ${{ gitea.sha }}
2023-12-13 08:54:30 +00:00
registry_url:
required: true
type: string
2023-12-14 08:53:54 +00:00
default: ${{ secrets.REGISTRY_URL }}
2023-12-13 08:54:30 +00:00
registry_user:
required: true
type: string
2023-12-14 08:53:54 +00:00
default: ${{ secrets.REGISTRY_USER }}
2023-12-13 08:54:30 +00:00
registry_pw:
required: true
type: secret
2023-12-14 08:53:54 +00:00
default: ${{ secrets.REGISTRY_PW }}
2023-12-13 08:54:30 +00:00
jobs:
build-container:
runs-on: buildah-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Split branch name
env:
REPO: ${{ inputs.repository }}
id: split
run: echo "::set-output name=repo_name::${REPO##*/}"
- name: Build image
id: build-image
uses: redhat-actions/buildah-build@v2
with:
image: ${{ inputs.registry_user }}/${{ steps.split.outputs.repo_name }}
tags: ${{ inputs.ref_name }} ${{ inputs.sha }}
archs: ${{ inputs.archs }}
containerfiles: |
./Containerfile
- name: Push to registry
id: push-to-registry
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.build-image.outputs.tags }}
registry: ${{ inputs.registry_url }}
username: ${{ inputs.registry_user }}
password: ${{ inputs.registry_pw }}