Skip to content

Fly Deploy

Fly Deploy #730

Workflow file for this run

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