Skip to content

Refactor code

Refactor code #31

Workflow file for this run

name: LocalStack Ephemeral Instance Test
on: pull_request
jobs:
preview-test:
permissions: write-all
name: 'Test ephemeral instance workflow'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Deploy Preview
uses: jenseng/dynamic-uses@v1
with:
uses: LocalStack/setup-localstack@${{ env.action-version }}
with: |-
{
"github-token": "${{ secrets.GITHUB_TOKEN }}",
"state-backend": "preview",
"state-action": "start",
"skip-preview-stop": "true"
}
env:
LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_API_KEY }}
action-version: ${{ fromJSON(format('["{0}","{1}"]', github.ref_name, github.head_ref))[github.event_name == 'pull_request'] }}
# We want explicit shutdown
- name: Shutdown ephemeral instance
uses: jenseng/dynamic-uses@v1
with:
uses: LocalStack/setup-localstack@${{ env.action-version }}
with: |-
{
"github-token": "${{ secrets.GITHUB_TOKEN }}",
"state-backend": "preview",
"state-action": "stop"
}
env:
LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_API_KEY }}
action-version: ${{ fromJSON(format('["{0}","{1}"]', github.ref_name, github.head_ref))[github.event_name == 'pull_request'] }}