Skip to content

Commit

Permalink
chore: test release CI job [WIP]
Browse files Browse the repository at this point in the history
  • Loading branch information
f1ames committed Oct 18, 2023
1 parent 7f2516a commit 3ff12ba
Showing 1 changed file with 36 additions and 20 deletions.
56 changes: 36 additions & 20 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
pull_request: # For testing only

jobs:
build-and-push:
Expand All @@ -21,7 +22,8 @@ jobs:

- name: Extract version from tag
id: extract_version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
#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 }}
Expand All @@ -32,32 +34,46 @@ jobs:
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/
docker push kubeshop/monokle-admission-controller-init:${VERSION}
docker push kubeshop/monokle-admission-controller-init:latest
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/
docker push kubeshop/monokle-admission-controller-server:${VERSION}
docker push kubeshop/monokle-admission-controller-server:latest
ls -la
# docker push kubeshop/monokle-admission-controller-server:${VERSION}
# docker push kubeshop/monokle-admission-controller-server:latest

create-release:
runs-on: ubuntu-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

steps:
- name: Checkout Repository
uses: actions/checkout@v2
# create-release:
# runs-on: ubuntu-latest

- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
# 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

0 comments on commit 3ff12ba

Please sign in to comment.