-
Notifications
You must be signed in to change notification settings - Fork 6
94 lines (80 loc) · 2.72 KB
/
Copy pathdeploy.yml
File metadata and controls
94 lines (80 loc) · 2.72 KB
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Deploy Demo to VPS
on:
workflow_run:
workflows: ["Publish"]
types:
- completed
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
deploy-frontend:
runs-on: ubuntu-latest
# If previous workflow was successful or this was triggered manually
if: ${{ github.event.workflow_run.conclusion == 'success' && github.repository == 'TimChild/reflex-clerk-api' }} || github.event_name == 'workflow_dispatch'
environment:
name: demo
permissions:
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Check env vars set
run: |
if [ -z "${{ vars.CLERK_PUBLISHABLE_KEY }}" ]; then
echo "CLERK_PUBLISHABLE_KEY is not set"
exit 1
fi
- name: Create .env
run: |
echo "CLERK_PUBLISHABLE_KEY=${{ vars.CLERK_PUBLISHABLE_KEY }}" >> .env
# echo "CLERK_SECRET_KEY=${{ secrets.CLERK_SECRET_KEY }}" >> .env
- name: Deploy frontend
uses: TimChild/webserver-template/actions/deploy-reflex-frontend@main
with:
vps-ip: ${{ vars.VPS_IP }}
site-name: ${{ vars.SITE_NAME }}
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
ssh-user: "webadmin"
working-directory: clerk_api_demo
- name: Remove .env
if: always()
run: rm .env
deploy-backend:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' && github.repository == 'TimChild/reflex-clerk-api' }} || github.event_name == 'workflow_dispatch'
environment:
name: demo
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Check env vars set
run: |
if [ -z "${{ vars.CLERK_PUBLISHABLE_KEY }}" ]; then
echo "CLERK_PUBLISHABLE_KEY is not set"
exit 1
fi
if [ -z "${{ secrets.CLERK_SECRET_KEY }}" ]; then
echo "CLERK_SECRET_KEY is not set"
exit 1
fi
- name: Create .env
run: |
echo "CLERK_PUBLISHABLE_KEY=${{ vars.CLERK_PUBLISHABLE_KEY }}" >> .env
echo "CLERK_SECRET_KEY=${{ secrets.CLERK_SECRET_KEY }}" >> .env
- name: Deploy backend
uses: TimChild/webserver-template/actions/deploy-reflex-backend@main
with:
vps-ip: ${{ vars.VPS_IP }}
site-name: ${{ vars.SITE_NAME }}
dotenv-path: .env
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
ssh-user: "webadmin"
working-directory: clerk_api_demo
- name: Remove .env
if: always()
run: rm .env