Skip to content

Commit 5319b0a

Browse files
authored
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
1 parent 4ee7714 commit 5319b0a

File tree

1 file changed

+21
-11
lines changed

1 file changed

+21
-11
lines changed

.github/workflows/cd-badger.yml

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
name: cd-badger
2-
on: workflow_dispatch
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
releasetag:
6+
description: 'releasetag'
7+
required: true
8+
type: string
39
jobs:
410
badger-build-amd64:
511
runs-on: ubuntu-20.04
612
steps:
713
- uses: actions/checkout@v3
14+
with:
15+
ref: '${{ github.event.inputs.releasetag }}'
816
- name: Get Go Version
917
run: |
1018
#!/bin/bash
@@ -17,15 +25,15 @@ jobs:
1725
- name: Set Badger Release Version
1826
run: |
1927
#!/bin/bash
20-
GIT_BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)
21-
if [[ "$GIT_BRANCH_NAME" == "release/v"* ]];
28+
GIT_TAG_NAME='${{ github.event.inputs.releasetag }}'
29+
if [[ "$GIT_TAG_NAME" == "v"* ]];
2230
then
23-
echo "this is a release branch"
31+
echo "this is a release tag"
2432
else
25-
echo "this is NOT a release branch"
33+
echo "this is NOT a release tag"
2634
exit 1
2735
fi
28-
BADGER_RELEASE_VERSION=$(git rev-parse --abbrev-ref HEAD | sed 's/release\///')
36+
BADGER_RELEASE_VERSION='${{ github.event.inputs.releasetag }}'
2937
echo "making a new release for "$BADGER_RELEASE_VERSION
3038
echo "BADGER_RELEASE_VERSION=$BADGER_RELEASE_VERSION" >> $GITHUB_ENV
3139
- name: Fetch dependencies
@@ -46,6 +54,8 @@ jobs:
4654
runs-on: [self-hosted, ARM64]
4755
steps:
4856
- uses: actions/checkout@v3
57+
with:
58+
ref: '${{ github.event.inputs.releasetag }}'
4959
- name: Get Go Version
5060
run: |
5161
#!/bin/bash
@@ -58,15 +68,15 @@ jobs:
5868
- name: Set Badger Release Version
5969
run: |
6070
#!/bin/bash
61-
GIT_BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)
62-
if [[ "$GIT_BRANCH_NAME" == "release/v"* ]];
71+
GIT_TAG_NAME='${{ github.event.inputs.releasetag }}'
72+
if [[ "$GIT_TAG_NAME" == "v"* ]];
6373
then
64-
echo "this is a release branch"
74+
echo "this is a release tag"
6575
else
66-
echo "this is NOT a release branch"
76+
echo "this is NOT a release tag"
6777
exit 1
6878
fi
69-
BADGER_RELEASE_VERSION=$(git rev-parse --abbrev-ref HEAD | sed 's/release\///')
79+
BADGER_RELEASE_VERSION='${{ github.event.inputs.releasetag }}'
7080
echo "making a new release for "$BADGER_RELEASE_VERSION
7181
echo "BADGER_RELEASE_VERSION=$BADGER_RELEASE_VERSION" >> $GITHUB_ENV
7282
- name: Fetch dependencies

0 commit comments

Comments
 (0)