Skip to content

Commit

Permalink
Create instance when it is not exist instead of relying on pull reque…
Browse files Browse the repository at this point in the history
…st event (#4437)

* Create instance

* Create instance

* Create instance
  • Loading branch information
andrzejewsky authored and poulch committed Dec 18, 2023
1 parent 1da2476 commit 58ecc5a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/tiny-pumas-leave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"saleor-dashboard": patch
---

Create instance when it has been not created yet
15 changes: 12 additions & 3 deletions .github/workflows/pr-automation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,19 @@ jobs:
- name: Saleor login
uses: ./.github/actions/cli-login
with:
token: ${{ secrets.STAGING_TOKEN }}
token: ${{ secrets.STAGING_TOKEN }}

- name: Instance check
id: instance_check
env:
SALEOR_CLI_ENV: staging
INSTANCE_NAME: ${{ needs.prepare_variables.outputs.POOL_NAME }}
run: |
INSTANCE_KEY=$(npx saleor env show "$INSTANCE_NAME" --json | jq .key)
echo "INSTANCE_KEY=$INSTANCE_KEY" >> $GITHUB_OUTPUT
- name: Reload snapshot
if: ${{ github.event_name == 'pull_request' && github.event.action != 'opened' && github.event.action != 'closed' }}
if: ${{ steps.instance_check.outputs.INSTANCE_KEY }}
env:
SALEOR_CLI_ENV: staging
BACKUP_ID: ${{ needs.prepare_variables.outputs.BACKUP_ID }}
Expand All @@ -101,7 +110,7 @@ jobs:
--skip-webhooks-update
- name: Create new instance
if: ${{ github.event_name == 'pull_request' && github.event.action == 'opened' }}
if: ${{ !steps.instance_check.outputs.INSTANCE_KEY }}
env:
SALEOR_CLI_ENV: staging
BACKUP_ID: ${{ needs.prepare_variables.outputs.BACKUP_ID }}
Expand Down

0 comments on commit 58ecc5a

Please sign in to comment.