Skip to content

Commit

Permalink
Merge pull request #13 from ana-cozma/add-indexnow
Browse files Browse the repository at this point in the history
Adds IndexNow
  • Loading branch information
ana-cozma authored Aug 12, 2024
2 parents cbc1b8b + a5774ca commit 2a38cf0
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions .github/workflows/deploy_gh_pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: Deploy Hugo site via GitHub Pages
on:
push:
branches:
- main # Set a branch to deploy
- main
pull_request:
workflow_dispatch:

Expand Down Expand Up @@ -40,7 +40,11 @@ jobs:
uses: actions/configure-pages@v5

- name: Build
run: hugo --minify --baseURL "${{ steps.pages.outputs.base_url }}"
run: hugo --minify --baseURL "${{ steps.pages.outputs.base_url }}"

- name: Create IndexNow API key
if: ${{ github.event_name == 'push' }}
run: echo ${{ secrets.INDEXNOW_KEY }} > ./public/${{ secrets.INDEXNOW_KEY }}.txt

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
Expand All @@ -53,8 +57,22 @@ jobs:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' }}
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

- name: Push changes to IndexNow
uses: bojieyang/indexnow-action@v2
with:
sitemap-location: "${{ steps.deployment.outputs.page_url }}sitemap.xml"
since: 1
since-unit: "day"
key: ${{ secrets.INDEXNOW_KEY }}

- name: Delete artifact
uses: geekyeggo/delete-artifact@v5
with:
name: github-pages

0 comments on commit 2a38cf0

Please sign in to comment.