Fly.io Deploy #60
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'Fly.io Deploy' | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: 30 12 * * 5 | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: superfly/flyctl-actions/setup-flyctl@master | |
with: | |
version: 0.2.69 | |
- name: prepare secrets | |
env: | |
SECRETS: "${{ toJSON(secrets) }}" | |
run: | | |
grep -v ^\# < .secrets >> $GITHUB_ENV | |
echo "$SECRETS" | jq -r 'keys[] as $k | "\($k)=\(.[$k])"' >> $GITHUB_ENV | |
- name: create app | |
run: flyctl apps create --name $FLY_APP 2>/dev/null || true | |
- name: create volume | |
run: flyctl volume create vaultwarden -y -n 1 -r $FLY_REGION 2>/dev/null || true | |
- name: exports secrets | |
run: env | grep ^APP_ | sed 's/^APP_//g' | flyctl secrets import --stage | |
- name: deploy app | |
run: flyctl deploy --yes --remote-only --regions $FLY_REGION |