Skip to content

Commit

Permalink
Merge pull request #13 from near-daos/develop
Browse files Browse the repository at this point in the history
Fixed release artifacts tagging for github actions
  • Loading branch information
okalenyk authored Jan 18, 2022
2 parents 3a12806 + edb102b commit d6bb710
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/build-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
namespace_prefix: ${{ steps.get-environment.outputs.namespace_prefix }}
k8s_ingress_base_host: ${{ steps.get-environment.outputs.k8s_ingress_base_host }}
kube_config_data_secret_name: ${{ steps.get-environment.outputs.kube_config_data_secret_name }}
docker_env_tag: ${{ steps.get-environment.outputs.docker_env_tag }}
steps:
- name: get environment
id: get-environment
Expand All @@ -37,16 +38,21 @@ jobs:
echo "::set-output name=namespace_prefix::dao-stats-api-production"
echo "::set-output name=k8s_ingress_base_host::api.daostats.io"
echo "::set-output name=kube_config_data_secret_name::KUBE_CONFIG_DATA_PRODUCTION"
echo "::set-output name=docker_env_tag::${GITHUB_REF#refs/*/}"
elif [[ "${{ github.ref }}" =~ ^refs/heads/staging ]]
then
echo "::set-output name=environment::staging"
echo "::set-output name=namespace_prefix::ds-s"
echo "::set-output name=k8s_ingress_base_host::staging.api.daostats.io"
echo "::set-output name=kube_config_data_secret_name::KUBE_CONFIG_DATA_DEVELOP"
echo "::set-output name=docker_env_tag::staging-$GITHUB_SHA"
elif [[ "${{ github.ref }}" =~ ^refs/heads/develop ]]
then
echo "::set-output name=environment::develop"
echo "::set-output name=namespace_prefix::ds-d"
echo "::set-output name=k8s_ingress_base_host::development.api.daostats.io"
echo "::set-output name=kube_config_data_secret_name::KUBE_CONFIG_DATA_DEVELOP"
echo "::set-output name=docker_env_tag::develop-$GITHUB_SHA"
fi
if [[ "${{ github.event.inputs.environment }}" != "" ]]
then
Expand All @@ -55,6 +61,7 @@ jobs:
echo "::set-output name=namespace_prefix::ds-d"
echo "::set-output name=k8s_ingress_base_host::development.api.daostats.io"
echo "::set-output name=kube_config_data_secret_name::KUBE_CONFIG_DATA_DEVELOP"
echo "::set-output name=docker_env_tag::develop-$GITHUB_SHA"
fi
build-image-aggregator:
Expand All @@ -70,7 +77,7 @@ jobs:
- uses: actions/checkout@v2
- name: Set Environment
run: |
echo DOCKER_ENV_TAG=${{ needs.get-environment.outputs.environment }}-$GITHUB_SHA >> $GITHUB_ENV
echo DOCKER_ENV_TAG=${{ needs.get-environment.outputs.docker_env_tag }} >> $GITHUB_ENV
cat ".github/env.common" | grep -E -v '^\ *#' >>$GITHUB_ENV
cat ".github/env.${{ needs.get-environment.outputs.environment }}" | grep -E -v '^\ *#' >>$GITHUB_ENV
- name: Docker Build Publish
Expand All @@ -89,7 +96,7 @@ jobs:
- uses: actions/checkout@v2
- name: Set Environment
run: |
echo DOCKER_ENV_TAG=${{ needs.get-environment.outputs.environment }}-$GITHUB_SHA >> $GITHUB_ENV
echo DOCKER_ENV_TAG=${{ needs.get-environment.outputs.docker_env_tag }} >> $GITHUB_ENV
cat ".github/env.common" | grep -E -v '^\ *#' >>$GITHUB_ENV
cat ".github/env.${{ needs.get-environment.outputs.environment }}" | grep -E -v '^\ *#' >>$GITHUB_ENV
- name: Docker Build Publish
Expand All @@ -109,7 +116,7 @@ jobs:
- uses: actions/checkout@v2
- name: Set Environment
run: |
echo DOCKER_ENV_TAG=${{ needs.get-environment.outputs.environment }}-$GITHUB_SHA >> $GITHUB_ENV
echo DOCKER_ENV_TAG=${{ needs.get-environment.outputs.docker_env_tag }} >> $GITHUB_ENV
cat ".github/env.common" | grep -E -v '^\ *#' >>$GITHUB_ENV
cat ".github/env.${{ needs.get-environment.outputs.environment }}" | grep -E -v '^\ *#' >>$GITHUB_ENV
- name: Helm Deploy
Expand Down Expand Up @@ -144,7 +151,7 @@ jobs:
- uses: actions/checkout@v2
- name: Set Environment
run: |
echo DOCKER_ENV_TAG=${{ needs.get-environment.outputs.environment }}-$GITHUB_SHA >> $GITHUB_ENV
echo DOCKER_ENV_TAG=${{ needs.get-environment.outputs.docker_env_tag }} >> $GITHUB_ENV
cat ".github/env.common" | grep -E -v '^\ *#' >>$GITHUB_ENV
cat ".github/env.${{ needs.get-environment.outputs.environment }}" | grep -E -v '^\ *#' >>$GITHUB_ENV
- name: Helm Deploy
Expand Down

0 comments on commit d6bb710

Please sign in to comment.