-
Notifications
You must be signed in to change notification settings - Fork 1
49 lines (47 loc) · 1.82 KB
/
platformatic-preview.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
name: Deploy to Platformatic cloud
on:
pull_request:
paths-ignore:
- 'docs/**'
- '**.md'
# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
cancel-in-progress: true
jobs:
build_and_deploy:
runs-on: ubuntu-latest
environment:
name: development
steps:
- name: Checkout application project repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: npm install --omit=dev
run: npm install --omit=dev
- name: Get PR number
id: get_pull_number
run: |
pull_number=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH")
echo "pull_number=${pull_number}" >> $GITHUB_OUTPUT
echo $pull_number
- uses: neondatabase/create-branch-action@v4
with:
project_id: ${{ secrets.NEON_PROJECT_ID }}
branch_name: pr-${{ steps.get_pull_number.outputs.pull_number }}
api_key: ${{ secrets.NEON_API_KEY }}
id: create-branch
- name: Deploy project
uses: platformatic/onestep@latest
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
platformatic_workspace_id: ${{ secrets.PLATFORMATIC_DYNAMIC_WORKSPACE_ID }}
platformatic_workspace_key: ${{ secrets.PLATFORMATIC_DYNAMIC_WORKSPACE_KEY }}
platformatic_config_path: ./platformatic.db.json
env:
PLT_SERVER_LOGGER_LEVEL: info
PORT: 3042
PLT_SERVER_HOSTNAME: 127.0.0.1
PLT_ADMIN_SECRET: ${{ secrets.PLT_ADMIN_SECRET }}
PLT_LOCK: ${{ vars.PLT_LOCK }}
PLT_LEADER_POLL: ${{ vars.PLT_LEADER_POLL }}
DATABASE_URL: ${{ steps.create-branch.outputs.db_url }}