Skip to content

Introduce release process #1

Introduce release process

Introduce release process #1

Workflow file for this run

name: Release
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
pull_request: # For testing only
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract version from tag
id: extract_version
#run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
run: echo "VERSION=0.0.1" >> $GITHUB_ENV
- name: Debug version
run: echo ${{ env.VERSION }}
- name: Build and publish Docker image (init container)
env:
VERSION: ${{ env.VERSION }}
run: |
echo "Building Docker init image with version: ${VERSION}"
docker build -t kubeshop/monokle-admission-controller-init:latest -t kubeshop/monokle-admission-controller-init:${VERSION} ./admission-controller/init/
ls -la
# docker push kubeshop/monokle-admission-controller-init:${VERSION}
# docker push kubeshop/monokle-admission-controller-init:latest
- name: Build and publish Docker image (server container)
env:
VERSION: ${{ env.VERSION }}
run: |
echo "Building Docker server image with version: ${VERSION}"
docker build -t kubeshop/monokle-admission-controller-server:latest -t kubeshop/monokle-admission-controller-server:${VERSION} ./admission-controller/server/
ls -la
# docker push kubeshop/monokle-admission-controller-server:${VERSION}
# docker push kubeshop/monokle-admission-controller-server:latest
# See https://docs.docker.com/docker-hub/oci-artifacts/#push-a-helm-chart
- name: Build and publish Helm chart
env:
VERSION: ${{ env.VERSION }}
run: |
echo "Building Helm chart with version: ${VERSION}"
helm package ./helm --version ${VERSION}
helm package ./helm --version latest
ls -la
# helm push monokle-admission-controller-${VERSION}.tgz
# helm push monokle-admission-controller-latest.tgz
# create-release:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout Repository
# uses: actions/checkout@v2
# - name: Create GitHub Release
# id: create_release
# uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.CI_BOT_TOKEN }}
# with:
# tag_name: ${{ github.ref }}
# release_name: Release ${{ github.ref }}
# draft: false
# prerelease: false