Skip to content

Commit d9b9909

Browse files
CBDEVOPS-503 update release tag
1 parent 9a6801d commit d9b9909

File tree

1 file changed

+36
-14
lines changed

1 file changed

+36
-14
lines changed

.github/workflows/build-deploy.yml

Lines changed: 36 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ jobs:
1111
set_environment:
1212
outputs:
1313
my_env: ${{ steps.setenv.outputs.my_env }}
14+
tag: ${{ steps.setenv.outputs.tag }}
1415
runs-on: ubuntu-latest
1516
steps:
1617
- id: setenv
@@ -20,6 +21,7 @@ jobs:
2021
fi
2122
if [[ $GITHUB_REF_NAME =~ ^[0-9]+\.[0-9]+$ ]]; then
2223
echo "release tag: $GITHUB_REF_NAME"
24+
echo "tag=$GITHUB_REF_NAME" >> $GITHUB_OUTPUT
2325
echo "my_env=production" >> $GITHUB_OUTPUT
2426
fi
2527
@@ -30,21 +32,41 @@ jobs:
3032
name: ${{ needs.set_environment.outputs.my_env }}
3133
name: ${{ needs.set_environment.outputs.my_env }}-release
3234
steps:
33-
- name: Generate Heroku Config
34-
id: set_heroku_config
35+
- name: Clone Reusable Actions Repo
3536
run: |
36-
cat <<EOF > ~/.netrc
37-
machine api.heroku.com
38-
login ${{ secrets.HEROKU_EMAIL }}
39-
password ${{ secrets.HEROKU_API_TOKEN }}
40-
machine git.heroku.com
41-
login ${{ secrets.HEROKU_EMAIL }}
42-
password ${{ secrets.HEROKU_API_TOKEN }}
43-
EOF
44-
- name: release scaffold
45-
id: release_scaffold
46-
run: |
47-
heroku config:set REACT_NATIVE_SCAFFOLD_REPO_BRANCH=$GITHUB_REF_NAME -a ${{ secrets.HEROKU_APP }}
37+
git clone -b master https://${{ secrets.GIT_TOKEN }}@github.com/crowdbotics/github-actions.git
38+
39+
- name: Azure login
40+
uses: azure/login@v2.1.1
41+
with:
42+
creds: "${{ secrets.AZURE_CREDENTIALS }}"
43+
44+
- name: Set up kubelogin for non-interactive login
45+
uses: azure/use-kubelogin@v1
46+
with:
47+
kubelogin-version: "v0.0.25"
48+
49+
- name: Get K8s context
50+
uses: azure/aks-set-context@v4
51+
with:
52+
resource-group: ${{ secrets.AZURE_RESOURCE_GROUP }}
53+
cluster-name: ${{ secrets.AZURE_CLUSTER_NAME }}
54+
admin: "false"
55+
use-kubelogin: "true"
56+
57+
- name: Update REACT_NATIVE_SCAFFOLD_REPO_BRANCH env var
58+
id: update-env-var
59+
uses: ./github-actions/set-azure-env-var
60+
with:
61+
resource_group: ${{ secrets.AZURE_RESOURCE_GROUP }}
62+
cluster_name: ${{ secrets.AZURE_CLUSTER_NAME }}
63+
app_name: crowdbotics-app
64+
app_namespace: cb-core
65+
env_var: REACT_NATIVE_SCAFFOLD_REPO_BRANCH
66+
env_value: ${{ needs.set_environment.outputs.tag }}
67+
token: ${{ secrets.GIT_TOKEN }}
68+
azure_credentials: ${{ secrets.AZURE_CREDENTIALS }}
69+
4870
- uses: act10ns/slack@v2
4971
if: ${{ needs.set_environment.outputs.my_env }} == 'production'
5072
env:

0 commit comments

Comments
 (0)