Google Indexing API #88
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: Google Indexing API | |
on: | |
schedule: | |
- cron: '0 0 * * *' # Menjalankan setiap hari pada pukul 00:00 UTC | |
workflow_dispatch: | |
jobs: | |
indexing: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install google-auth google-auth-oauthlib google-auth-httplib2 google-api-python-client requests | |
- name: Set up Google Cloud credentials | |
env: | |
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }} | |
run: | | |
echo "${GOOGLE_APPLICATION_CREDENTIALS}" > credentials.json | |
export GOOGLE_APPLICATION_CREDENTIALS="credentials.json" | |
- name: Submit URLs to Google Indexing API | |
run: | | |
python submit_to_google_indexing_api.py | |
- name: Commit updates to updated.md | |
env: | |
GH_PAT: ${{ secrets.GH_PAT }} | |
run: | | |
git config --global user.name 'DomathID' | |
git config --global user.email 'admin@yukinoshita.web.id' | |
git add updated.md | |
git commit -m "Update with the latest submitted URLs" | |
git push https://DomathID:${{ secrets.GH_PAT }}@github.com/DomathID/auto-indexing.git HEAD:main | |