11
11
set_environment :
12
12
outputs :
13
13
my_env : ${{ steps.setenv.outputs.my_env }}
14
+ tag : ${{ steps.setenv.outputs.tag }}
14
15
runs-on : ubuntu-latest
15
16
steps :
16
17
- id : setenv
20
21
fi
21
22
if [[ $GITHUB_REF_NAME =~ ^[0-9]+\.[0-9]+$ ]]; then
22
23
echo "release tag: $GITHUB_REF_NAME"
24
+ echo "tag=$GITHUB_REF_NAME" >> $GITHUB_OUTPUT
23
25
echo "my_env=production" >> $GITHUB_OUTPUT
24
26
fi
25
27
@@ -30,21 +32,41 @@ jobs:
30
32
name : ${{ needs.set_environment.outputs.my_env }}
31
33
name : ${{ needs.set_environment.outputs.my_env }}-release
32
34
steps :
33
- - name : Generate Heroku Config
34
- id : set_heroku_config
35
+ - name : Clone Reusable Actions Repo
35
36
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
+
48
70
- uses : act10ns/slack@v2
49
71
if : ${{ needs.set_environment.outputs.my_env }} == 'production'
50
72
env :
0 commit comments