Skip to content

Commit

Permalink
fix(ci): using the latest image tag in the manual deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
geekbrother committed Jan 18, 2024
1 parent 9513406 commit 815c44b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
17 changes: 12 additions & 5 deletions .github/workflows/dispatch_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ on:
version:
description: "Release Version"
type: string
default: '-current-'
default: 'latest'

concurrency: deploy

Expand All @@ -37,8 +37,8 @@ permissions:

jobs:
get_deployed_version:
name: Lookup Version
if: ${{ !inputs.deploy-app && inputs.version == '-current-' }}
name: Lookup deployed version
if: ${{ !inputs.deploy-app && inputs.version == 'latest' }}
secrets: inherit
uses: WalletConnect/ci_workflows/.github/workflows/[email protected]
with:
Expand All @@ -55,11 +55,18 @@ jobs:
runs-on:
group: ${{ vars.RUN_GROUP }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Select target version
id: select_version
run: |
if [ "${{ inputs.deploy-app }}" != "true" ] && [ "${{ inputs.version }}" == "-current-" ]; then
if [ "${{ inputs.deploy-app }}" != "true" ] && [ "${{ inputs.version }}" == "latest" ]; then
echo "version=${{ needs.get_deployed_version.outputs.version }}" >> "$GITHUB_OUTPUT"
elif [ "${{ inputs.version }}" == "latest" ]; then
echo "version=$(git tag | sort --version-sort | tail -n1)" >> "$GITHUB_OUTPUT"
else
echo "version=${{ inputs.version }}" >> "$GITHUB_OUTPUT"
fi
Expand All @@ -76,4 +83,4 @@ jobs:
deploy-infra: ${{ inputs.deploy-infra }}
deploy-app: ${{ inputs.deploy-app }}
deploy-prod: ${{ inputs.stage == 'prod' }}
version: ${{ needs.select_version .outputs.version }}
version: ${{ needs.select_version.outputs.version }}
4 changes: 3 additions & 1 deletion .github/workflows/sub-providers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
run: |
if [[ -n "${{ github.event.inputs.providers }}" ]]; then
PROVIDERS_LIST="${{ github.event.inputs.providers }}"
else
elif [[ -n "${{ github.event.before }}" && -n "${{ github.sha }}" ]]; then
PROVIDERS_DIR="${{ inputs.providers-directory }}"
CHANGED_FILES=$(git diff --name-only "${{ github.event.before }}" "${{ github.sha }}")
PROVIDERS_LIST=""
Expand All @@ -52,6 +52,8 @@ jobs:
done
PROVIDERS_LIST="${PROVIDERS_LIST% }"
else
PROVIDERS_LIST=""
fi
JSON_FMT=$(printf '[%s]' "$(echo $PROVIDERS_LIST | awk '{for(i=1;i<=NF;i++) printf "\"%s\",", $i}' | sed 's/,$//')")
Expand Down

0 comments on commit 815c44b

Please sign in to comment.