Skip to content

Commit

Permalink
add github action
Browse files Browse the repository at this point in the history
  • Loading branch information
zpatronus committed Nov 11, 2024
1 parent 54253b8 commit 0039779
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Trigger Deployment on Commit

on:
push:
branches:
- main

jobs:
send-post-request:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Generate TOTP Code
id: generate_totp
run: |
echo "SECRET_KEY=${{ secrets.SECRET_KEY }}" >> $GITHUB_ENV
echo "from datetime import datetime; import pyotp; print(pyotp.TOTP('${{ secrets.SECRET_KEY }}').now())" > totp.py
TOTP_CODE=$(python3 totp.py)
echo "code=$TOTP_CODE" >> $GITHUB_ENV
- name: Send POST request to Verifier
run: |
curl -X POST "${{ secrets.FLASK_VERIFIER_URL }}/verify" \
-d "code=${{ env.code }}"

0 comments on commit 0039779

Please sign in to comment.