feat(study set): tạo hit cho người dùng ở chế độ học write #1158
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: | |
- main | |
- 'feat/*' | |
- 'dev/*' | |
pull_request: | |
branches: | |
- main | |
- 'feat/*' | |
- 'dev/*' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
java-version: [ 17 ] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK ${{ matrix.java-version }} | |
uses: actions/setup-java@v4 | |
with: | |
java-version: ${{ matrix.java-version }} | |
distribution: 'temurin' | |
cache: gradle | |
- name: Cache Gradle dependencies | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: gradle-${{ runner.os }}-jdk-${{ matrix.java-version }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
restore-keys: | | |
gradle-${{ runner.os }}-jdk-${{ matrix.java-version }}- | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
# - name: Upload checksum results | |
# uses: actions/upload-artifact@v4 | |
# with: | |
# name: checksum-results | |
# path: checksum.txt | |
- name: Build with Gradle | |
run: ./gradlew build | |
# - name: Upload APK | |
# if: success() | |
# uses: actions/upload-artifact@v4 | |
# with: | |
# name: app | |
# path: app/build/outputs/**/*.apk | |
- name: Send Telegram Notification on Success | |
if: success() | |
run: | | |
curl -X POST "https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendMessage" \ | |
-d chat_id="${{ secrets.TELEGRAM_CHAT_ID }}" \ | |
-d text="🎉 <b>Build Successful!</b> 🎉%0A<b>Project</b>: 🚀 <a href='https://github.com/${{ github.repository }}'>${{ github.repository }}</a>%0A<b>Committer</b>: 👤 ${{ github.actor }}%0A<b>Message</b>: 💬 ${{ github.event.head_commit.message }}%0A<b>Branch</b>: 🌿 <code>${{ github.ref_name }}</code>%0A<b>Changes</b>: 🔗 <a href='https://github.com/${{ github.repository }}/commit/${{ github.sha }}'>View Changes</a>%0A<b>Workflow</b>: 📄 <a href='https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}'>Details</a>%0A<b>Deployed At</b>: 🌐 <a href='https://api.quickmem.app'>QuickMem Server</a>" \ | |
-d parse_mode="HTML" | |
- name: Send Telegram Notification on Failure | |
if: failure() | |
run: | | |
curl -X POST "https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendMessage" \ | |
-d chat_id="${{ secrets.TELEGRAM_CHAT_ID }}" \ | |
-d text="⚠️ <b>Build Failed!</b> ⚠️%0A<b>Project</b>: 🚀 <a href='https://github.com/${{ github.repository }}'>${{ github.repository }}</a>%0A<b>Committer</b>: 👤 ${{ github.actor }}%0A<b>Message</b>: 💬 ${{ github.event.head_commit.message }}%0A<b>Branch</b>: 🌿 <code>${{ github.ref_name }}</code>%0A<b>Changes</b>: 🔗 <a href='https://github.com/${{ github.repository }}/commit/${{ github.sha }}'>View Changes</a>%0A<b>Workflow</b>: 📄 <a href='https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}'>Details</a>%0A<b>Error Details</b>: ❌ Check logs for more information." \ | |
-d parse_mode="HTML" |