chore(cd): tag based deployments (#1887)

## Problem
issue example ->
<img width="360" alt="Screen Shot 2023-02-27 at 19 36 26"
src="https://user-images.githubusercontent.com/108091997/221665204-0b2e706f-3deb-4fc3-b325-f386446afcf7.png">

Needs a better standardization

## Solution
solution example ->
<img width="430" alt="Screen Shot 2023-02-27 at 19 36 19"
src="https://user-images.githubusercontent.com/108091997/221665241-bd658b82-c200-4760-a011-2e7665680a45.png">

Migrating to this model
This commit is contained in:
Sudhish
2023-02-27 21:47:06 +00:00
committed by GitHub
parent 11ed340bf5
commit 659bb68d56
+21 -11
View File
@@ -1,10 +1,18 @@
name: cd-badger
on: workflow_dispatch
on:
workflow_dispatch:
inputs:
releasetag:
description: 'releasetag'
required: true
type: string
jobs:
badger-build-amd64:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
ref: '${{ github.event.inputs.releasetag }}'
- name: Get Go Version
run: |
#!/bin/bash
@@ -17,15 +25,15 @@ jobs:
- name: Set Badger Release Version
run: |
#!/bin/bash
GIT_BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)
if [[ "$GIT_BRANCH_NAME" == "release/v"* ]];
GIT_TAG_NAME='${{ github.event.inputs.releasetag }}'
if [[ "$GIT_TAG_NAME" == "v"* ]];
then
echo "this is a release branch"
echo "this is a release tag"
else
echo "this is NOT a release branch"
echo "this is NOT a release tag"
exit 1
fi
BADGER_RELEASE_VERSION=$(git rev-parse --abbrev-ref HEAD | sed 's/release\///')
BADGER_RELEASE_VERSION='${{ github.event.inputs.releasetag }}'
echo "making a new release for "$BADGER_RELEASE_VERSION
echo "BADGER_RELEASE_VERSION=$BADGER_RELEASE_VERSION" >> $GITHUB_ENV
- name: Fetch dependencies
@@ -46,6 +54,8 @@ jobs:
runs-on: [self-hosted, ARM64]
steps:
- uses: actions/checkout@v3
with:
ref: '${{ github.event.inputs.releasetag }}'
- name: Get Go Version
run: |
#!/bin/bash
@@ -58,15 +68,15 @@ jobs:
- name: Set Badger Release Version
run: |
#!/bin/bash
GIT_BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)
if [[ "$GIT_BRANCH_NAME" == "release/v"* ]];
GIT_TAG_NAME='${{ github.event.inputs.releasetag }}'
if [[ "$GIT_TAG_NAME" == "v"* ]];
then
echo "this is a release branch"
echo "this is a release tag"
else
echo "this is NOT a release branch"
echo "this is NOT a release tag"
exit 1
fi
BADGER_RELEASE_VERSION=$(git rev-parse --abbrev-ref HEAD | sed 's/release\///')
BADGER_RELEASE_VERSION='${{ github.event.inputs.releasetag }}'
echo "making a new release for "$BADGER_RELEASE_VERSION
echo "BADGER_RELEASE_VERSION=$BADGER_RELEASE_VERSION" >> $GITHUB_ENV
- name: Fetch dependencies