-
Notifications
You must be signed in to change notification settings - Fork 1
40 lines (34 loc) · 991 Bytes
/
fly.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
name: Fly Deploy
on:
push:
branches:
- main
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
jobs:
deploy:
name: Deploy app
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup flyctl
uses: superfly/flyctl-actions/setup-flyctl@master
- name: Set fly secrets
env:
ALL_SECRETS: ${{ toJSON(secrets) }}
shell: bash
run: |
secrets=""
newline=$'\n'
while read -r line ; do
# your code goes here
key=${line%%=*}
value=${line#*=}
key=${key#"FLY_SECRET_"}
secrets+="${key}=${value}${newline}"
done < <(echo $ALL_SECRETS | jq -r 'to_entries[] | "\(.key)=\(.value)"' | grep ^FLY_SECRET_)
echo -n "$secrets" | flyctl secrets import --stage
flyctl secrets list
- name: Deploy to Fly.io
run: flyctl deploy --remote-only