-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #465 from crowdbotics/CBDEVOPS-503
CBDEVOPS-503 update release tag
- Loading branch information
Showing
1 changed file
with
36 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ jobs: | |
set_environment: | ||
outputs: | ||
my_env: ${{ steps.setenv.outputs.my_env }} | ||
tag: ${{ steps.setenv.outputs.tag }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- id: setenv | ||
|
@@ -20,6 +21,7 @@ jobs: | |
fi | ||
if [[ $GITHUB_REF_NAME =~ ^[0-9]+\.[0-9]+$ ]]; then | ||
echo "release tag: $GITHUB_REF_NAME" | ||
echo "tag=$GITHUB_REF_NAME" >> $GITHUB_OUTPUT | ||
echo "my_env=production" >> $GITHUB_OUTPUT | ||
fi | ||
|
@@ -30,21 +32,41 @@ jobs: | |
name: ${{ needs.set_environment.outputs.my_env }} | ||
name: ${{ needs.set_environment.outputs.my_env }}-release | ||
steps: | ||
- name: Generate Heroku Config | ||
id: set_heroku_config | ||
- name: Clone Reusable Actions Repo | ||
run: | | ||
cat <<EOF > ~/.netrc | ||
machine api.heroku.com | ||
login ${{ secrets.HEROKU_EMAIL }} | ||
password ${{ secrets.HEROKU_API_TOKEN }} | ||
machine git.heroku.com | ||
login ${{ secrets.HEROKU_EMAIL }} | ||
password ${{ secrets.HEROKU_API_TOKEN }} | ||
EOF | ||
- name: release scaffold | ||
id: release_scaffold | ||
run: | | ||
heroku config:set REACT_NATIVE_SCAFFOLD_REPO_BRANCH=$GITHUB_REF_NAME -a ${{ secrets.HEROKU_APP }} | ||
git clone -b master https://${{ secrets.GIT_TOKEN }}@github.com/crowdbotics/github-actions.git | ||
- name: Azure login | ||
uses: azure/[email protected] | ||
with: | ||
creds: "${{ secrets.AZURE_CREDENTIALS }}" | ||
|
||
- name: Set up kubelogin for non-interactive login | ||
uses: azure/use-kubelogin@v1 | ||
with: | ||
kubelogin-version: "v0.0.25" | ||
|
||
- name: Get K8s context | ||
uses: azure/aks-set-context@v4 | ||
with: | ||
resource-group: ${{ secrets.AZURE_RESOURCE_GROUP }} | ||
cluster-name: ${{ secrets.AZURE_CLUSTER_NAME }} | ||
admin: "false" | ||
use-kubelogin: "true" | ||
|
||
- name: Update REACT_NATIVE_SCAFFOLD_REPO_BRANCH env var | ||
id: update-env-var | ||
uses: ./github-actions/set-azure-env-var | ||
with: | ||
resource_group: ${{ secrets.AZURE_RESOURCE_GROUP }} | ||
cluster_name: ${{ secrets.AZURE_CLUSTER_NAME }} | ||
app_name: crowdbotics-app | ||
app_namespace: cb-core | ||
env_var: REACT_NATIVE_SCAFFOLD_REPO_BRANCH | ||
env_value: ${{ needs.set_environment.outputs.tag }} | ||
token: ${{ secrets.GIT_TOKEN }} | ||
azure_credentials: ${{ secrets.AZURE_CREDENTIALS }} | ||
|
||
- uses: act10ns/slack@v2 | ||
if: ${{ needs.set_environment.outputs.my_env }} == 'production' | ||
env: | ||
|