|
| 1 | +# This workflow will build the CodeFlare Operator image and push it to the project-codeflare image registry |
| 2 | + |
| 3 | +name: Image |
| 4 | + |
| 5 | +on: |
| 6 | + workflow_dispatch: |
| 7 | + push: |
| 8 | + tags: |
| 9 | + - "*" |
| 10 | + |
| 11 | +jobs: |
| 12 | + push: |
| 13 | + runs-on: ubuntu-latest |
| 14 | + steps: |
| 15 | + - uses: actions/checkout@v3 |
| 16 | + |
| 17 | + - name: Install operator-sdk |
| 18 | + run: | |
| 19 | + export ARCH=$(case $(uname -m) in x86_64) echo -n amd64 ;; aarch64) echo -n arm64 ;; *) echo -n $(uname -m) ;; esac) |
| 20 | + export OS=$(uname | awk '{print tolower($0)}') |
| 21 | + export OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/v1.27.0 |
| 22 | + curl -LO ${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH} |
| 23 | + chmod +x operator-sdk_${OS}_${ARCH} && sudo mv operator-sdk_${OS}_${ARCH} /usr/local/bin/operator-sdk |
| 24 | +
|
| 25 | +
|
| 26 | + - name: Grab New Version Tag |
| 27 | + id: tag_name |
| 28 | + run: | |
| 29 | + echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/} |
| 30 | +
|
| 31 | + - name: Login to Quay.io |
| 32 | + uses: redhat-actions/podman-login@v1 |
| 33 | + with: |
| 34 | + username: ${{ secrets.QUAY_ID }} |
| 35 | + password: ${{ secrets.QUAY_TOKEN }} |
| 36 | + registry: quay.io |
| 37 | + |
| 38 | + - name: Login to Red Hat Registry |
| 39 | + uses: redhat-actions/podman-login@v1 |
| 40 | + with: |
| 41 | + username: ${{ secrets.RH_REG_ID }} |
| 42 | + password: ${{ secrets.RH_REG_TOKEN }} |
| 43 | + registry: registry.redhat.io |
| 44 | + |
| 45 | + - name: Image Build |
| 46 | + run: | |
| 47 | + make build |
| 48 | + make bundle |
| 49 | + make image-build -e IMG=quay.io/project-codeflare/codeflare-operator:${SOURCE_TAG} |
| 50 | + podman tag quay.io/project-codeflare/codeflare-operator:${SOURCE_TAG} quay.io/project-codeflare/codeflare-operator:latest |
| 51 | + env: |
| 52 | + SOURCE_TAG: ${{ steps.tag_name.outputs.SOURCE_TAG }} |
| 53 | + |
| 54 | + - name: Image Push |
| 55 | + run: | |
| 56 | + make image-push -e IMG=quay.io/project-codeflare/codeflare-operator:${SOURCE_TAG} |
| 57 | + make image-push -e IMG=quay.io/project-codeflare/codeflare-operator:latest |
| 58 | + env: |
| 59 | + SOURCE_TAG: ${{ steps.tag_name.outputs.SOURCE_TAG }} |
0 commit comments