Skip to content

Commit

Permalink
chore(cd): tag based deployments (#1887)
Browse files Browse the repository at this point in the history
## 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
  • Loading branch information
skrdgraph authored Feb 27, 2023
1 parent 4ee7714 commit 5319b0a
Showing 1 changed file with 21 additions and 11 deletions.
32 changes: 21 additions & 11 deletions .github/workflows/cd-badger.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 5319b0a

Please sign in to comment.