Skip to content

Commit

Permalink
Step "Save previous sitemap file" doesn't actualy save the previous s…
Browse files Browse the repository at this point in the history
…itemap

Checkout gh-pages branch and update the "Save previous sitemap file" step to
save the sitemap.xml file in that checked out branch to /tmp/previous-sitemap.xml.
Rename the exiting step "Checkout gh-pages source" to "Update gh-pages source"
to better describe its purpose: to retrieve the latest published sitemap.xml.
  • Loading branch information
dydz committed Aug 28, 2021
1 parent 25d5c54 commit 6877ac2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/github-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,21 @@ jobs:
- name: Copy CNAME file to ./blog
run: cp -np CNAME ./blog
shell: bash
- name: Checkout gh-pages source
uses: actions/checkout@v2
with:
ref: "gh-pages"
path: "BuiltGitHubPages"
- name: Save previous sitemap file
run: "[ -f ./blog/_site/sitemap.xml ] && cp -np ./blog/_site/sitemap.xml /tmp/previous-sitemap.xml || exit 0"
run: "[ -f ./BuiltGitHubPages/sitemap.xml ] && cp -np ./BuiltGitHubPages/sitemap.xml /tmp/previous-sitemap.xml || exit 0"
shell: bash
- name: Build and publish site
uses: helaili/[email protected]
with:
jekyll_src: "./blog"
target_branch: "gh-pages"
token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout gh-pages source
- name: Update gh-pages source
uses: actions/checkout@v2
with:
ref: "gh-pages"
Expand Down

0 comments on commit 6877ac2

Please sign in to comment.