add initial container file and github build action #5
Workflow file for this run
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
name: container builds | |
on: | |
pull_request: | |
# TODO: remove this when this workflow should be run for every Ceph PR | |
paths: | |
- .github/workflows/container.yaml | |
- container/** | |
push: | |
branches: | |
- main | |
defaults: | |
run: | |
# reference: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#using-a-specific-shell | |
shell: bash --noprofile --norc -eo pipefail -x {0} | |
permissions: | |
contents: read | |
jobs: | |
crossbuild: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Generate container metadata | |
id: container-meta | |
uses: crazy-max/ghaction-docker-meta@v1 | |
with: | |
images: quay.io/ceph/ceph-staging | |
tag-latest: true # TODO: only if from branch head | |
- name: Buildah Build | |
id: container-build | |
uses: redhat-actions/buildah-build@v2 | |
with: | |
base-image: quay.io/centos/centos:stream8 | |
containerfiles: ./container/Containerfile | |
extra-args: --squash | |
platforms: linux/amd64, linux/arm64 | |
labels: | | |
${{ steps.container-meta.outputs.labels }} | |
tags: | | |
${{ steps.container-meta.outputs.tags }} | |
build-args: | | |
CEPH_VERSION_NAME=main | |
CEPH_PACKAGE_VERSION= | |
GANESHA_PACKAGE_VERSION= | |
IS_DEVEL=true | |
CEPH_REF=main | |
OSD_FLAVOR=default | |
# TODO: remove after verified token allows login | |
- name: Login to Container Registry | |
if: github.repository_owner == 'ceph' | |
uses: docker/login-action@v3 | |
with: | |
registry: quay.io/ceph/ceph-staging | |
username: ceph+ceph_staging_ci | |
password: ${{ secrets.CEPH_STAGING_QUAY_TOKEN }} | |
# TODO: push image | |
# - name: Push To quay.io | |
# if: # WHEN? | |
# uses: redhat-actions/push-to-registry@v2 | |
# with: | |
# image: ${{ steps.container-build.outputs.image }} | |
# tags: ${{ steps.container-build.outputs.tags }} | |
# registry: quay.io/ceph/ceph-staging | |
# username: ceph+ceph_staging_ci | |
# password: ${{ secrets.CEPH_STAGING_QUAY_TOKEN }} |