Last active
August 26, 2020 11:14
-
-
Save codeaholicguy/892da97f124b42547d5bdd17a0c848b0 to your computer and use it in GitHub Desktop.
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
name: main | |
on: | |
# Cho phép chạy bằng tay từ giao diện Github | |
workflow_dispatch: | |
# Lên lịch chạy hàng ngày vào lúc 00:00 UTC | |
schedule: | |
- cron: "0 0 * * *" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v1 | |
# Khởi tạo môi trường NodeJS | |
with: | |
node-version: 12.16.1 | |
- run: npm ci | |
- name: Generate quote | |
# Chạy script để gọi API lấy quote sau đó sửa file README.md | |
run: npm run generate | |
- name: Update README.md | |
# Push file README.md đã được thay đổi lên github | |
run: | | |
git config --global user.email "john@example.com" | |
git config --global user.name "example" | |
git add . | |
git commit -m "Updated README.md" || echo "No changes to commit" | |
git push |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment