Add verification action if the image is using latest version (#3132)
This commit is contained in:
parent
0af551eab0
commit
987196635a
1 changed files with 16 additions and 3 deletions
19
.github/workflows/deploy-demo-staging.yaml
vendored
19
.github/workflows/deploy-demo-staging.yaml
vendored
|
@ -2,7 +2,7 @@ name: Deploy to staging demo
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- 3.11.**
|
- 3.**
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
git_ref:
|
git_ref:
|
||||||
|
@ -10,7 +10,7 @@ on:
|
||||||
required: true
|
required: true
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-22.04
|
||||||
env:
|
env:
|
||||||
API_URI: /graphql/
|
API_URI: /graphql/
|
||||||
APP_MOUNT_URI: /dashboard/
|
APP_MOUNT_URI: /dashboard/
|
||||||
|
@ -23,10 +23,23 @@ jobs:
|
||||||
APPS_MARKETPLACE_API_URI: "https://apps.staging.saleor.io/api/v2/saleor-apps"
|
APPS_MARKETPLACE_API_URI: "https://apps.staging.saleor.io/api/v2/saleor-apps"
|
||||||
ENVIRONMENT: demo-staging
|
ENVIRONMENT: demo-staging
|
||||||
DEMO_MODE: true
|
DEMO_MODE: true
|
||||||
|
NOTIFY: true
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
ref: ${{ github.event.inputs.git_ref || '' }}
|
ref: ${{ github.event.inputs.git_ref || '' }}
|
||||||
|
- name: Check version
|
||||||
|
run: |
|
||||||
|
export GITHUB_TOKEN=$( \
|
||||||
|
curl --request GET --url ${{ secrets.VAULT_URL}} --header "Authorization: JWT ${{ secrets.VAULT_JWT }}" | jq -r .token \
|
||||||
|
)
|
||||||
|
version=${{ github.event.inputs.git_ref || github.ref_name }}
|
||||||
|
latest_version=$(gh api -H "Accept: application/vnd.github+json" --jq .name /repos/saleor/saleor-dashboard/releases/latest)
|
||||||
|
if ! [[ $version != $latest_version ]]; then
|
||||||
|
echo "Unsupported version: $version"
|
||||||
|
echo "NOTIFY=false" >> $GITHUB_ENV
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
|
@ -64,7 +77,7 @@ jobs:
|
||||||
}
|
}
|
||||||
}'
|
}'
|
||||||
- name: Notify Slack
|
- name: Notify Slack
|
||||||
if: ${{ always() }}
|
if: ${{ always() && env.NOTIFY }}
|
||||||
env:
|
env:
|
||||||
JOB_DEPLOYMENT_KIND: production
|
JOB_DEPLOYMENT_KIND: production
|
||||||
JOB_STATUS: ${{ job.status }}
|
JOB_STATUS: ${{ job.status }}
|
||||||
|
|
Loading…
Reference in a new issue