diff --git a/.github/workflows/deploy-demo-staging.yaml b/.github/workflows/deploy-demo-staging.yaml index 6312d1591..52bffb7b8 100644 --- a/.github/workflows/deploy-demo-staging.yaml +++ b/.github/workflows/deploy-demo-staging.yaml @@ -2,7 +2,7 @@ name: Deploy to staging demo on: push: tags: - - 3.11.** + - 3.** workflow_dispatch: inputs: git_ref: @@ -10,7 +10,7 @@ on: required: true jobs: build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 env: API_URI: /graphql/ APP_MOUNT_URI: /dashboard/ @@ -23,10 +23,23 @@ jobs: APPS_MARKETPLACE_API_URI: "https://apps.staging.saleor.io/api/v2/saleor-apps" ENVIRONMENT: demo-staging DEMO_MODE: true + NOTIFY: true steps: - uses: actions/checkout@v2 with: 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 uses: actions/setup-node@v3 with: @@ -64,7 +77,7 @@ jobs: } }' - name: Notify Slack - if: ${{ always() }} + if: ${{ always() && env.NOTIFY }} env: JOB_DEPLOYMENT_KIND: production JOB_STATUS: ${{ job.status }}