Skip to content

Commit

Permalink
Add singapore to deploy matrix (#23)
Browse files Browse the repository at this point in the history
* add singapore to matrix

* Use actionlint instead of download it

* fix lint
  • Loading branch information
adolsalamanca committed Sep 14, 2023
1 parent 21bd34e commit dcd9c11
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 42 deletions.
64 changes: 32 additions & 32 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -133,30 +133,30 @@ jobs:

- name: Helm Upgrade
run: |
region_values=''
region_values=''
if [[ -e "./${{ inputs.chart_path }}/values/${{ inputs.env }}-${{ inputs.region }}.yaml" ]]; then
region_values=--values=./${{ inputs.chart_path }}/values/${{ inputs.env }}-${{ inputs.region }}.yaml
region_values=--values=./"${{ inputs.chart_path }}/values/${{ inputs.env }}-${{ inputs.region }}".yaml
fi
standard_values=''
if [[ "${{inputs.helm_inject_standard_deploy_values}}" == "true" ]]; then
standard_values="--set-string imageName=${{ inputs.registry }} --set-string imageTag=${{ inputs.tag }} --set-string deployment.region=${{ inputs.region }}"
standard_values=--set-string imageName="${{ inputs.registry }}" --set-string imageTag="${{ inputs.tag }}" --set-string deployment.region="${{ inputs.region }}"
fi
helm upgrade ${{ inputs.chart_name }} ${{ inputs.chart_path }} --install --wait --atomic --cleanup-on-fail \
--kubeconfig=./kubeconfig_${{ inputs.env }}_${{ inputs.region }} \
--namespace=${{ inputs.chart_namespace }} \
--values=./${{ inputs.chart_path }}/values/${{ inputs.env }}.yaml \
--timeout ${{ inputs.helm_timeout }} \
${region_values} \
${standard_values} \
${{ inputs.helm_ext_args }}
helm upgrade "${{ inputs.chart_name }}" "${{ inputs.chart_path }}" --install --wait --atomic --cleanup-on-fail \
--kubeconfig="./kubeconfig_${{ inputs.env }}_${{ inputs.region }}" \
--namespace="${{ inputs.chart_namespace }}" \
--values="./${{ inputs.chart_path }}/values/${{ inputs.env }}.yaml" \
--timeout "${{ inputs.helm_timeout }}" \
"${region_values}" \
"${standard_values}" \
"${{ inputs.helm_ext_args }}"
# Prod - Deploy against all the regions specified in strategy.matrix.region
deploy_all_regions_prod:
if: inputs.region == 'all' && inputs.env == 'prod'
strategy:
max-parallel: 1
matrix:
region: [us-east-1, us-west-2, eu-west-1, eu-central-1, ap-southeast-2, us-east-2]
region: [us-east-1, us-west-2, eu-west-1, eu-central-1, ap-southeast-2, us-east-2, ap-southeast-1]
runs-on: ${{ inputs.env }}-${{ matrix.region }}
name: Deploy-all ${{ inputs.env }}-${{ matrix.region }}@${{ inputs.tag }}
steps:
Expand Down Expand Up @@ -188,20 +188,20 @@ jobs:
echo "####### Helm upgrade for ${{ inputs.env }}_${{ matrix.region }} ####### "
region_values=''
if [[ -e "./${{ inputs.chart_path }}/values/${{ inputs.env }}-${{ matrix.region }}.yaml" ]]; then
region_values=--values=./${{ inputs.chart_path }}/values/${{ inputs.env }}-${{ matrix.region }}.yaml
region_values=--values=./"${{ inputs.chart_path }}/values/${{ inputs.env }}-${{ matrix.region }}".yaml
fi
standard_values=''
if [[ "${{inputs.helm_inject_standard_deploy_values}}" == "true" ]]; then
standard_values="--set-string imageName=${{ inputs.registry }} --set-string imageTag=${{ inputs.tag }} --set-string deployment.region=${{ matrix.region }}"
standard_values="--set-string imageName=${{ inputs.registry }} --set-string imageTag=${{ inputs.tag }} --set-string deployment.region=${{ inputs.region }}"
fi
helm upgrade ${{ inputs.chart_name }} ${{ inputs.chart_path }} --install --wait --atomic --cleanup-on-fail \
--kubeconfig=./kubeconfig_${{ inputs.env }}_${{ matrix.region }} \
--namespace=${{ inputs.chart_namespace }} \
--values=./${{ inputs.chart_path }}/values/${{ inputs.env }}.yaml \
--timeout ${{ inputs.helm_timeout }} \
${region_values} \
${standard_values} \
${{ inputs.helm_ext_args }}
helm upgrade "${{ inputs.chart_name }}" "${{ inputs.chart_path }}" --install --wait --atomic --cleanup-on-fail \
--kubeconfig="./kubeconfig_${{ inputs.env }}_${{ matrix.region }}" \
--namespace="${{ inputs.chart_namespace }}" \
--values="./${{ inputs.chart_path }}/values/${{ inputs.env }}.yaml" \
--timeout "${{ inputs.helm_timeout }}" \
"${region_values}" \
"${standard_values}" \
"${{ inputs.helm_ext_args }}"
# Dev - Deploy against all the regions specified in strategy.matrix.region
deploy_all_regions_dev:
Expand Down Expand Up @@ -237,17 +237,17 @@ jobs:
echo "####### Helm upgrade for ${{ inputs.env }}_${{ matrix.region }} ####### "
region_values=''
if [[ -e "./${{ inputs.chart_path }}/values/${{ inputs.env }}-${{ matrix.region }}.yaml" ]]; then
region_values=--values=./${{ inputs.chart_path }}/values/${{ inputs.env }}-${{ matrix.region }}.yaml
region_values=--values=./"${{ inputs.chart_path }}/values/${{ inputs.env }}-${{ matrix.region }}".yaml
fi
standard_values=''
if [[ "${{inputs.helm_inject_standard_deploy_values}}" == "true" ]]; then
standard_values="--set-string imageName=${{ inputs.registry }} --set-string imageTag=${{ inputs.tag }} --set-string deployment.region=${{ matrix.region }}"
standard_values="--set-string imageName=${{ inputs.registry }} --set-string imageTag=${{ inputs.tag }} --set-string deployment.region=${{ inputs.region }}"
fi
helm upgrade ${{ inputs.chart_name }} ${{ inputs.chart_path }} --install --wait --atomic --cleanup-on-fail \
--kubeconfig=./kubeconfig_${{ inputs.env }}_${{ matrix.region }} \
--namespace=${{ inputs.chart_namespace }} \
--values=./${{ inputs.chart_path }}/values/${{ inputs.env }}.yaml \
--timeout ${{ inputs.helm_timeout }} \
${region_values} \
${standard_values} \
${{ inputs.helm_ext_args }}
helm upgrade "${{ inputs.chart_name }}" "${{ inputs.chart_path }}" --install --wait --atomic --cleanup-on-fail \
--kubeconfig="./kubeconfig_${{ inputs.env }}_${{ matrix.region }}" \
--namespace="${{ inputs.chart_namespace }}" \
--values="./${{ inputs.chart_path }}/values/${{ inputs.env }}.yaml" \
--timeout "${{ inputs.helm_timeout }}" \
"${region_values}" \
"${standard_values}" \
"${{ inputs.helm_ext_args }}"
16 changes: 6 additions & 10 deletions .github/workflows/linter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,10 @@ jobs:
id: files
uses: jitterbit/get-changed-files@v1
continue-on-error: true

- name: Download action linter
run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)

- name: Run action linter
run: |
./actionlint -oneline -ignore 'label ".+" is unknown' \
-ignore '".+" is potentially untrusted' \
-ignore '".+" SC2086 ".+"' \
${{ steps.files.outputs.all }} \

- uses: reviewdog/action-actionlint@v1
with:
actionlint_flags: -config-file .github/actionlint.yaml
fail_on_error: true
level: error

3 changes: 3 additions & 0 deletions actionlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
self-hosted-runner:
labels:
- non-prod

0 comments on commit dcd9c11

Please sign in to comment.