sync_searcher #38
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: sync_searcher | |
on: | |
workflow_dispatch: | |
workflow_run: | |
workflows: ["publish_docs"] | |
types: | |
- completed | |
push: | |
branches: | |
- master | |
paths: | |
- search.html | |
jobs: | |
deploy: | |
if: github.actor == 'samapriya' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Wait for GitHub Pages | |
run: | | |
# Wait for 2 minutes to allow GitHub Pages deployment to complete | |
echo "Waiting for GitHub Pages deployment to complete..." | |
sleep 120 | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Checkout gh-pages branch | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
ref: gh-pages | |
- name: Download search.html | |
run: | | |
curl -o search.html https://raw.githubusercontent.com/samapriya/awesome-gee-community-datasets/refs/heads/master/search.html | |
- name: Configure Git | |
run: | | |
git config user.name "GitHub Action" | |
git config user.email "action@github.com" | |
- name: Commit search.html to gh-pages | |
run: | | |
git add search.html | |
git commit -m "Add search.html from external source" | |
- name: Push changes to gh-pages | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git push origin gh-pages |