Skip to content

Run Selenium Java application built with Maven #184

Run Selenium Java application built with Maven

Run Selenium Java application built with Maven #184

Workflow file for this run

name: Run Selenium Java application built with Maven
on:
push: # commment for easy access
branches:
- master
pull_request:
branches:
- master
schedule:
- cron: "0 1 * * *" # it will be 6~7 am in our timezone
jobs:
run-selenium-script:
runs-on: ubuntu-latest
if: always()
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
distribution: "temurin"
java-version: "11"
- name: Set up Chrome browser
run: google-chrome --version
# Install dependencies with Maven
- name: Build with Maven
run: mvn install
# Run Selenium script using Maven and Send Telegram notification
- name: Run Selenium script & Notify via Telegram
run: |
mvn exec:java -Dexec.mainClass="eclass.kr.DeadlineNotifier" > OUTPUT.txt
curl -s -X POST https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendMessage -d chat_id=${{ secrets.TELEGRAM_CHAT_ID }} -d text="$(sed -n '/Today/,/^Bye/{/^Bye/d;p}' OUTPUT.txt)"
env:
ID: ${{ secrets.ID }}
PASSWORD: ${{ secrets.PASSWORD }}