Skip to content

Staging db

Staging db #1

Workflow file for this run

name: Deploy
on:
pull_request:
types: [opened, synchronize]
jobs:
setup-db:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup flyctl
uses: superfly/flyctl-actions/setup-flyctl@master
- name: Create database
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
id: create_db
run: |
OUTPUT=$(flyctl postgres create \
--org personal \
--region arn \
--initial-cluster-size 1 \
--vm-size shared-cpu-1x \
--volume-size 3 \
--name echo-web-stg-db-${{ github.event.pull_request.number}})
echo "$OUTPUT" > output.txt
- name: Parse db url
id: parse_db_password
run: |
PASSWORD=$(grep -oP 'Password:\s+\K\w+' output.txt)
echo "PASSWORD=$PASSWORD" >> $GITHUB_ENV