From 1dbe89357513267daf08a86be5808aa8d64cf2e2 Mon Sep 17 00:00:00 2001 From: Luke Morfill Date: Tue, 6 Feb 2024 16:52:14 +0000 Subject: [PATCH] Deploy to github --- .github/workflows/okd-release.yaml | 44 ++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/okd-release.yaml diff --git a/.github/workflows/okd-release.yaml b/.github/workflows/okd-release.yaml new file mode 100644 index 000000000..90a3bccda --- /dev/null +++ b/.github/workflows/okd-release.yaml @@ -0,0 +1,44 @@ +name: okd-release + +on: + workflow_dispatch: {} +jobs: + image-push: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 1 + + - uses: actions/setup-go@v4 + with: + go-version-file: go.mod + + - uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push docker images + env: + IMAGE_REPOSITORY: ghcr.io/teamziax/noobaa-operator + run: | + function strip_prefix() { + local str="$1" + local prefix="$2" + + echo ${str#"$prefix"} + } + + function get_noobaa_version() { + local version=$(go run cmd/version/main.go) + local without_v=$(strip_prefix "$version" v) + + echo "v$without_v" + } + + make all + + docker tag noobaa ${IMAGE_REPOSITORY}/noobaa-operator:$(get_noobaa_version) + docker push ${IMAGE_REPOSITORY}/noobaa-operator:$(get_noobaa_version)