forked from rook/rook
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #594 from parth-gr/ci-action
ci: push downstream image to ocs/dev
- Loading branch information
Showing
2 changed files
with
72 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,54 @@ | ||
name: Push Image Build Downstream | ||
on: | ||
push: | ||
branches: | ||
- master | ||
- release-* | ||
|
||
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: | ||
push-image-to-container-registry: | ||
runs-on: ubuntu-20.04 | ||
if: github.repository == 'red-hat-storage/rook' | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: "1.21" | ||
|
||
# docker/setup-qemu action installs QEMU static binaries, which are used to run builders for architectures other than the host. | ||
- name: set up QEMU | ||
uses: docker/setup-qemu-action@master | ||
with: | ||
platforms: all | ||
|
||
- name: log in to container registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: quay.io | ||
username: ${{ secrets.QUAY_OCS_DEV_ROBOT_USER }} | ||
password: ${{ secrets.QUAY_OCS_DEV_ROBOT_PASSWORD }} | ||
|
||
# creating custom env var | ||
- name: set env | ||
run: | | ||
echo "BRANCH_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV | ||
echo "GITHUB_SHA=${GITHUB_SHA}" >> $GITHUB_ENV | ||
- name: build and release | ||
env: | ||
BRANCH_NAME: ${{ env.BRANCH_NAME }} | ||
GITHUB_SHA: $ {{ env.GITHUB_SHA }} | ||
run: | | ||
tests/scripts/build-release-downstream.sh |
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,18 @@ | ||
#!/usr/bin/env bash | ||
set -ex | ||
|
||
MAKE='make --debug=v --output-sync' | ||
|
||
# build and push rook image | ||
$MAKE build BUILD_REGISTRY=local | ||
build_image="local/ceph-amd64:latest" | ||
git_hash=$(git rev-parse --short "${GITHUB_SHA}") | ||
tag_image=quay.io/ocs-dev/rook-ceph:v${BRANCH_NAME}-$git_hash | ||
docker tag "$build_image" "$tag_image" | ||
docker push "$tag_image" | ||
|
||
# build and push rook bundle | ||
export ROOK_IMAGE=$tag_image | ||
make gen-csv | ||
DOCKERCMD=podman BUNDLE_IMAGE=quay.io/ocs-dev/rook-ceph-operator-bundle:${BRANCH_NAME}-$git_hash make bundle | ||
podman push quay.io/ocs-dev/rook-ceph-operator-bundle:"${BRANCH_NAME}"-"$git_hash" |