Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions .github/workflows/deploy_dev_docs_to_cf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,19 @@ jobs:
mv staging/dev/releases.releases staging/releases.releases

- name: Push to Cloudflare Branch
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./.hugo/staging
publish_branch: cloudflare-pages
keep_files: true
commit_message: "deploy: ${{ github.event.head_commit.message }}"
run: |
cd $GITHUB_WORKSPACE
git clone --branch cloudflare-pages https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git cf-pages-temp
cd cf-pages-temp
rm -rf dev

# opy over the fresh dev build and releases file from staging
cp -r ../.hugo/staging/dev ./dev
cp ../.hugo/staging/releases.releases ./releases.releases || true

# Commit and push the clean build
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add .

git diff-index --quiet HEAD || git commit -m "deploy dev docs: ${{ github.event.head_commit.message }}" && git push origin cloudflare-pages
24 changes: 16 additions & 8 deletions .github/workflows/deploy_versioned_docs_to_cf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,19 @@ jobs:
working-directory: .hugo

- name: Deploy to root
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: .hugo/public
publish_branch: cloudflare-pages
keep_files: true
allow_empty_commit: true
commit_message: "deploy: docs to root for ${{ steps.get_version.outputs.VERSION }}"
run: |
cd $GITHUB_WORKSPACE
git clone --branch cloudflare-pages https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git cf-pages-root-temp

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use the checkout action?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated, also changed the bot to release please for CLA compliance

cd cf-pages-root-temp
# Delete older pagefind search indexes
rm -rf pagefind

# Copy over the fresh root build
cp -r ../.hugo/public/* .

# Commit and push the clean build
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add .

git diff-index --quiet HEAD || git commit -m "deploy: docs to root for ${{ steps.get_version.outputs.VERSION }}" && git push origin cloudflare-pages
Loading