Skip to content

0.4.0

0.4.0 #7

Workflow file for this run

name: Release Workflow
on:
release:
types:
- published
env:
GO_VERSION: ^1.20
HELM_VERSION: v3.11.2
REDIS_VERSION: 7.0.12
CRD_PATH: charts/operator-for-redis/crds/db.ibm.com_redisclusters.yaml
CRD_DIFF: crd.diff
jobs:
operator:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.meta.outputs.version }}
steps:
- name: Setup Buildx
uses: docker/setup-buildx-action@v2
- name: Prepare image metadata
uses: docker/metadata-action@v4
id: meta
with:
images: |
cinple/operator-for-redis
tags: type=ref,event=tag
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push operator image
uses: docker/build-push-action@v4
with:
file: Dockerfile.operator
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
BUILDTIME=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.created'] }}
OPERATOR_VERSION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
REVISION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.revision'] }}
cluster-node:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.meta.outputs.version }}
steps:
- name: Setup Buildx
uses: docker/setup-buildx-action@v2
- name: Prepare image metadata
uses: docker/metadata-action@v4
id: meta
with:
images: |
cinple/node-for-redis
tags: type=ref,event=tag
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push cluster node image
uses: docker/build-push-action@v4
with:
file: Dockerfile.node
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
BUILDTIME=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.created'] }}
OPERATOR_VERSION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
REVISION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.revision'] }}
metrics:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.meta.outputs.version }}
steps:
- name: Setup Buildx
uses: docker/setup-buildx-action@v2
- name: Prepare image metadata
uses: docker/metadata-action@v4
id: meta
with:
images: |
cinple/metrics-for-redis
tags: type=ref,event=tag
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push metrics image
uses: docker/build-push-action@v4
with:
file: Dockerfile.metrics
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
BUILDTIME=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.created'] }}
OPERATOR_VERSION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
REVISION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.revision'] }}
helm-release:
runs-on: ubuntu-latest
needs: [ operator, cluster-node, metrics ]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Helm
uses: azure/setup-helm@v3.5
with:
version: ${{ env.HELM_VERSION }}
- name: Ensure helm-releases folder exists
run: mkdir -p helm-releases
- name: Package operator-for-redis chart
env:
OPERATOR_VERSION: ${{ needs.operator.outputs.version }}
run: helm package charts/operator-for-redis --version=$OPERATOR_VERSION --destination helm-releases
- name: Package node-for-redis chart
env:
OPERATOR_VERSION: ${{ needs.operator.outputs.version }}
run: helm package charts/node-for-redis --version=$OPERATOR_VERSION --app-version=${{ env.REDIS_VERSION }} --destination helm-releases
- name: Push helm charts
env:
OPERATOR_VERSION: ${{ needs.operator.outputs.version }}
run: |
git config --global user.email ""
git config --global user.name "Github Actions CI"
helm repo index helm-releases --url https://raw.githubusercontent.com/${{ github.repository }}/operator-for-redis-cluster/main/helm-releases
git add helm-releases/*
git commit -a -m "Release $OPERATOR_VERSION"
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} HEAD:main
docs:
name: Publish Docs
needs: [ helm-release ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16.17.1 # This is recommended LTS version which includes npm 6.14.10
- name: Publish docs website
env:
USE_SSH: false
GIT_USER: git
CURRENT_BRANCH: main
DEPLOYMENT_BRANCH: gh-pages
GIT_PASS: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.email "actions@github.com"
git config --global user.name "gh-actions"
cd ./docs
npm ci
npx docusaurus deploy
assets:
name: Publish Assets
needs: [ docs ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: Build redis plugin
run: make build-kubectl-rc
- name: Publish redis plugin to assets
uses: skx/github-action-publish-binaries@release-2.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: './bin/kubectl-rc'