56 lines
1.5 KiB
YAML
56 lines
1.5 KiB
YAML
name: I really want to stay at your heart
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
# schedule:
|
|
# - cron: "10 23 * * 4,5"
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
setup:
|
|
env:
|
|
EPIC_EMAIL: ${{ secrets.EPIC_EMAIL }}
|
|
EPIC_PASSWORD: ${{ secrets.EPIC_PASSWORD }}
|
|
APPRISE_TELEGRAM: ${{ secrets.APPRISE_TELEGRAM }}
|
|
RIGHT_NOW: "Automated deployment @ $(date '+%Y-%m-%d %H:%M:%S') Asia/Shanghai"
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Clone & Init
|
|
run: |
|
|
sudo timedatectl set-timezone "Asia/Shanghai"
|
|
git clone -b hello-world https://github.com/QIN2DIM/epic-awesome-gamer.git epic
|
|
if [ -d "user_data_dir" ];then cp -rfp user_data_dir epic/user_data_dir/; fi
|
|
echo "{}" > epic/src/config.json
|
|
|
|
- uses: actions/setup-python@v4
|
|
with:
|
|
python-version: "3.10"
|
|
cache: 'pip'
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
pip install -r epic/requirements.txt
|
|
playwright install firefox
|
|
playwright install-deps firefox
|
|
|
|
- name: Run tasks
|
|
run: |
|
|
cd epic/src/
|
|
xvfb-run python claim.py
|
|
|
|
- name: Setup GIT user
|
|
uses: fregante/setup-git-user@v1
|
|
|
|
- name: Cache browser context
|
|
run: |
|
|
if [ -d "epic/user_data_dir" ];then cp -rfp epic/user_data_dir .; fi
|
|
if [ -d "epic/logs" ];then cp -rfp epic/logs .; fi
|
|
rm -rf epic
|
|
git add .
|
|
git commit -m "${{ env.RIGHT_NOW }}"
|
|
git push -f
|