Skip to content

New files from Fly.io Launch #740

New files from Fly.io Launch

New files from Fly.io Launch #740

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: |
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
echo "new_release=yes" >> $GITHUB_ENV
else
n=`date -d "2 day ago" "+%Y-%m-%d"`
l=$(wget -qO- -t1 -T2 "https://api.github.com/repos/nezhahq/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
fi
- name: deploy
if: ${{ env.new_release == 'yes' }}
run: |
# echo '${{ secrets.CONFIG }}' > ./config.yaml && ls
flyctl deploy --remote-only