generated from arthurgeek/vaultwarden-fly-template
-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (48 loc) · 1.44 KB
/
fly-deploy.yaml
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
name: Deploy to Fly
on:
workflow_dispatch: {}
push:
branches:
- main
paths:
- Dockerfile
- fly.toml
- config/**
- scripts/**
jobs:
check-fly-secret:
runs-on: ubuntu-latest
outputs:
fly-secret-exists: ${{ steps.fly-secret-check.outputs.defined }}
steps:
- name: Check for Fly secrets availability
id: fly-secret-check
# perform secret check & put boolean result as an output
shell: bash
run: |
if [ "${{ secrets.FLY_API_TOKEN }}" != '' ] && [ "${{ secrets.FLY_APP }}" != '' ]; then
echo "defined=true" >> $GITHUB_OUTPUT;
else
echo "defined=false" >> $GITHUB_OUTPUT;
fi
deploy:
name: Deploy app
runs-on: ubuntu-latest
needs: [check-fly-secret]
if: needs.check-fly-secret.outputs.fly-secret-exists == 'true'
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: superfly/flyctl-actions/setup-flyctl@master
with:
version: 0.1.54
- name: Install Task
uses: arduino/setup-task@v1
with:
# renovate: datasource=github-releases depName=go-task/task
version: 3.27.1
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Deploy app
run: flyctl deploy --remote-only -a $FLY_APP
env:
FLY_APP: ${{ secrets.FLY_APP }}
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}