-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (63 loc) · 3.34 KB
/
testing-deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Testing Stripe Connect Account Announcer
# Controls when the action will run.
on:
push:
branches-ignore:
- 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:
# This workflow contains a single job called "build"
deploy-testing:
name: Deploy testing Stripe Connect Account Announcer
runs-on: ubuntu-20.04
environment: testing
# 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 dosent 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 testing-stripe-connect-account-announcer
ssh dokku@$DOKKU_HOST -C "dokku apps:create testing-stripe-connect-account-announcer" | true
echo The url will be testing-stripe-connect-account-announcer.pcpink.co.uk
ssh dokku@$DOKKU_HOST -C "dokku git:initialize testing-stripe-connect-account-announcer"
ssh dokku@$DOKKU_HOST -C "dokku config:set --no-restart testing-stripe-connect-account-announcer BIND_ADDRESS=${{ secrets.BIND_ADDRESS }}"
ssh dokku@$DOKKU_HOST -C "dokku config:set --no-restart testing-stripe-connect-account-announcer LISTEN_PORT=${{ secrets.LISTEN_PORT }}"
ssh dokku@$DOKKU_HOST -C "dokku config:set --no-restart testing-stripe-connect-account-announcer PYTHON_LOG_LEVEL=${{ secrets.PYTHON_LOG_LEVEL }}"
ssh dokku@$DOKKU_HOST -C "dokku config:set --no-restart testing-stripe-connect-account-announcer REDIS_HOSTNAME=${{ secrets.REDIS_HOSTNAME }} REDIS_PORT=${{ secrets.REDIS_PORT }}"
ssh dokku@$DOKKU_HOST -C "dokku config:set --no-restart testing-stripe-connect-account-announcer REDIS_PASSWORD=${{ secrets.REDIS_PASSWORD }}"
ssh dokku@$DOKKU_HOST -C "dokku ps:set testing-stripe-connect-account-announcer restart-policy unless-stopped"
ssh dokku@$DOKKU_HOST -C "dokku ps:rebuild testing-stripe-connect-account-announcer"
- 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: 'testing-stripe-connect-account-announcer'
git-push-flags: --force
- id: smoke-test
name: Smoke test
run: |
set -x
curl -v -H 'Content-Type: application/json' -d '{"stripe_connect_account_id":"test", "site_url":"http://example.com"}' testing-stripe-connect-account-announcer.pcpink.co.uk:8001| grep 'test.*example.com'