Fix #29 valid json for smoketest response #25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Prod Stripe Connect Webhook Endpoint Router | |
| on: | |
| push: | |
| branches: [ main ] | |
| # Allows you to run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| # A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
| jobs: | |
| deploy-prod: | |
| name: Deploy to prod | |
| runs-on: ubuntu-20.04 | |
| environment: prod | |
| # Steps represent a sequence of tasks that will be executed as part of the job | |
| steps: | |
| # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
| - uses: actions/checkout@v2 | |
| with: | |
| fetch-depth: 0 | |
| - name: Prepare runner with ssh keys | |
| env: | |
| SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} | |
| DOKKU_HOST: ${{ secrets.DOKKU_HOST }} | |
| run: | | |
| set -x | |
| mkdir -p ~/.ssh | |
| eval `ssh-agent -s` | |
| ssh-add - <<< "$SSH_PRIVATE_KEY" | |
| ssh-keyscan $DOKKU_HOST >> ~/.ssh/known_hosts | |
| - name: Create dokku app if doesn't already exist using dokku apps:create | |
| env: | |
| SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} | |
| DOKKU_HOST: ${{ secrets.DOKKU_HOST }} | |
| run: | | |
| set -x | |
| eval `ssh-agent -s` | |
| ssh-add - <<< "$SSH_PRIVATE_KEY" | |
| echo Creating dokku app prod-stripe-connect-webhook-endpoint-router | |
| ssh dokku@$DOKKU_HOST -C "dokku apps:create prod-stripe-connect-webhook-endpoint-router" | true | |
| echo The url is set by $HOSTNAME in secrets | |
| ssh dokku@$DOKKU_HOST -C "dokku git:initialize prod-stripe-connect-webhook-endpoint-router" | |
| ssh dokku@$DOKKU_HOST -C "dokku config:set --no-restart prod-stripe-connect-webhook-endpoint-router REDIS_HOSTNAME=${{ secrets.REDIS_HOSTNAME }}" | |
| ssh dokku@$DOKKU_HOST -C "dokku config:set --no-restart prod-stripe-connect-webhook-endpoint-router REDIS_PORT=${{ secrets.REDIS_PORT }}" | |
| ssh dokku@$DOKKU_HOST -C "dokku config:set --no-restart prod-stripe-connect-webhook-endpoint-router REDIS_TIMEOUT_SECS=${{ secrets.REDIS_TIMEOUT_SECS }}" | |
| ssh dokku@$DOKKU_HOST -C "dokku config:set --no-restart prod-stripe-connect-webhook-endpoint-router REDIS_PASSWORD=${{ secrets.REDIS_PASSWORD }}" | |
| ssh dokku@$DOKKU_HOST -C "dokku config:set --no-restart prod-stripe-connect-webhook-endpoint-router STRIPE_WEBHOOK_SECRET=${{ secrets.STRIPE_WEBHOOK_SECRET }}" | |
| ssh dokku@$DOKKU_HOST -C "dokku config:set --no-restart prod-stripe-connect-webhook-endpoint-router STRIPE_WEBHOOK_PATH=${{ secrets.STRIPE_WEBHOOK_PATH }}" | |
| ssh dokku@$DOKKU_HOST -C "dokku config:set --no-restart prod-stripe-connect-webhook-endpoint-router PYTHON_LOG_LEVEL=${{ secrets.PYTHON_LOG_LEVEL }}" | |
| ssh dokku@$DOKKU_HOST -C "dokku ps:set-restart-policy prod-stripe-connect-webhook-endpoint-router unless-stopped" | |
| ssh dokku@$DOKKU_HOST -C "dokku ps:rebuild prod-stripe-connect-webhook-endpoint-router" | |
| - id: deploy | |
| name: Deploy to dokku | |
| uses: idoberko2/dokku-deploy-github-action@v1 | |
| with: | |
| ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
| dokku-host: ${{ secrets.DOKKU_HOST }} | |
| app-name: 'prod-stripe-connect-webhook-endpoint-router' | |
| git-push-flags: --force | |
| - id: smoke-test | |
| name: Smoke test | |
| run: | | |
| set -x | |
| curl -H 'Content-Type: application/json' -d '{"account":"-1"}' ${{ secrets.HOSTNAME }} | grep "No site_url for that account id" |