-
Notifications
You must be signed in to change notification settings - Fork 19
35 lines (29 loc) · 871 Bytes
/
deploy.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
name: Fly Deploy
on:
push:
workflow_dispatch:
schedule:
- cron: '30 20 * * *'
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
jobs:
deploy:
name: Deploy app
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: |
n=`date -d "2 day ago" "+%Y-%m-%d"`
l=$(wget -qO- -t1 -T2 "https://api.github.com/repos/naiba/nezha/releases/latest" | jq -r ".published_at")
if [[ $l =~ $n ]]
then
echo "new_release=yes" >> $GITHUB_ENV
else
echo "new_release=no" >> $GITHUB_ENV
fi
- name: deploy
if: ${{ env.new_release == 'yes' }}
run: |
echo '${{ secrets.CONFIG }}' > ./config.yaml && ls
flyctl deploy --remote-only