-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add coupon action workflow (#1)
* Create coupon.yml * Update coupon.yml * chore: update coupon * Update coupon.yml * Update coupon.yml
- Loading branch information
1 parent
188b82b
commit 11e38be
Showing
6 changed files
with
60 additions
and
14 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Uber Eats and Foodpanda coupon | ||
|
||
on: | ||
schedule: | ||
- cron: "0 */24 * * *" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
|
||
- name: Install dependencies | ||
run: | | ||
pip install -r requirements.txt | ||
- name: Run coupon code | ||
run: | | ||
python coupon-script/ubereats-coupon.py | ||
python coupon-script/foodpanda-coupon.py | ||
- name: Generate coupon md | ||
run: | | ||
python coupon-script/readme.py | ||
- name: Configure git | ||
run: | | ||
git config --global user.name "${{ vars.GITUSERNAME }}" | ||
git config --global user.email "${{ vars.GITUSEREMAIL }}" | ||
- name: Commit and push changes | ||
run: | | ||
if git diff-index --quiet HEAD --; then | ||
echo "No changes detected." | ||
else | ||
git add . | ||
git commit -m "chore: update coupon" | ||
fi | ||
continue-on-error: true | ||
|
||
- name: Push changes | ||
uses: ad-m/github-push-action@master | ||
with: | ||
branch: main | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
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
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
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
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
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