From 6255b08ef832fd1cd1ba6d57c33d7aac221573f9 Mon Sep 17 00:00:00 2001 From: zramsay Date: Wed, 5 Feb 2025 11:54:30 -0500 Subject: [PATCH] add namada --- .gitea/workflow/deploy-namada.yml | 43 ++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/.gitea/workflow/deploy-namada.yml b/.gitea/workflow/deploy-namada.yml index 4d94406..77420bb 100644 --- a/.gitea/workflow/deploy-namada.yml +++ b/.gitea/workflow/deploy-namada.yml @@ -1 +1,42 @@ -todo \ No newline at end of file +name: Check Latest Release + +on: + schedule: + - cron: '*/5 * * * *' + workflow_dispatch: + +env: + TARGET_REPO: zramsay/namada-interface + +jobs: + check-latest: + runs-on: ubuntu-latest + outputs: + run_workflow: ${{ steps.check.outputs.run_workflow }} + steps: + - name: Get latest release + id: check + run: | + latest=$(curl -s https://api.github.com/repos/${{ env.TARGET_REPO }}/releases/latest) + latest_tag=$(echo $latest | jq -r .tag_name) + published_at=$(echo $latest | jq -r .published_at) + + current_time=$(date -u +%s) + release_time=$(date -u -d "$published_at" +%s) + time_diff=$((current_time - release_time)) + + if [ $time_diff -le 300 ]; then + echo "run_workflow=true" >> $GITHUB_OUTPUT + else + echo "run_workflow=false" >> $GITHUB_OUTPUT + fi + + main_workflow: + needs: check-latest + if: needs.check-latest.outputs.run_workflow == 'true' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Example step + run: echo "Running workflow for new release"