Comments (6)
segg21's link to example doesn't work anymore, so I'm pasting here the contents of the .github/workflows/publish.yml
file that works for me.
on: [push]
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
name: Publish to Cloudflare Pages
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
# Run a build step here if your project requires
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x' # Set up the Python version
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Build the MkDocs site
run: mkdocs build # Builds your documentation
- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: YOUR_ACCOUNT_ID
projectName: YOUR_PROJECT_NAME
directory: ./site
# Optional: Enable this if you want to have GitHub Deployments triggered
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
# Optional: Switch what branch you are publishing to.
# By default this will be the branch which triggered this workflow
branch: main
from mkdocs-git-revision-date-localized-plugin.
Hi @segg21 ,
I am not familiar with cloudflare pages (https://pages.cloudflare.com/)
One thing you could do, is setup cloudflare pages to deploy your gh-pages
branch, instead of the default branch.
Now you can use mkdocs gh-deploy --force
(docs) locally to push the build to that branch automatically.
You could also use github actions to build and push to gh-pages
whenever you push to master
/ main
, see https://squidfunk.github.io/mkdocs-material/publishing-your-site/?h=github+ac#with-github-actions (but make sure to change the git clone depth in that case). Note that mkdocs gh-deploy
has an option to use a different branch name than gh-pages
also.
If you really want to use cloudflare builds, I can't help you with that. I searched for you, I didn't find an option to specify clone depth.
from mkdocs-git-revision-date-localized-plugin.
@segg21 What ended up being your solution to this? I also am in the same situation and cannot find any documentation on how to change the fetch-depth for CF Pages.
Instead of CloudFlare automatically detecting updates, building, and publishing itself, I'm using GitHub actions (that does building w/ fetch-depth) and pushing site contents to CloudFlare using cloudflare/pages-action@v1
Here an example of the action I have setup.
You'll need to disable GitHub automation within CloudFlare's dashboard for your page.
from mkdocs-git-revision-date-localized-plugin.
@segg21 What ended up being your solution to this? I also am in the same situation and cannot find any documentation on how to change the fetch-depth for CF Pages.
Instead of CloudFlare automatically detecting updates, building, and publishing itself, I'm using GitHub actions (that does building w/ fetch-depth) and pushing site contents to CloudFlare using cloudflare/pages-action@v1
Here an example of the action I have setup.
You'll need to disable GitHub automation within CloudFlare's dashboard for your page.
That makes perfect sense. Thanks for all the info! I think I'll follow your lead on this and do something similar.
from mkdocs-git-revision-date-localized-plugin.
Thanks. I ended up figuring out. I didn't want to use GitHub pages due to limitations, and the extra benefits CF pages provides.
from mkdocs-git-revision-date-localized-plugin.
@segg21 What ended up being your solution to this? I also am in the same situation and cannot find any documentation on how to change the fetch-depth for CF Pages.
from mkdocs-git-revision-date-localized-plugin.
Related Issues (20)
- Is there a way to turn off warnings? HOT 4
- Improve error message for dubious git ownership HOT 2
- if a file has no git logs, use the last modified timestamp instead of the current HOT 4
- which themes will this plugin work?
- Feature request: exclude specific commits when calculating the 'last update' calculation HOT 3
- Poor performance on large monorepos HOT 3
- Timeago setting results in incorrect items being added to extra_javascript HOT 2
- Create date not correct on Github pages HOT 4
- Document how to use sparse checkouts
- correctly populate `lastmod` of `sitemap.xml` HOT 2
- DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version HOT 1
- 1.2.3 breaks integration with Material for MkDocs HOT 5
- Whitelist / Negate certain excludes with a `!`? HOT 1
- Feature Request: Show datetime on hover when using timeago
- DeprecationWarning when using Mldocs Material 9.5.20 and Mkdocs 1.60 HOT 4
- The creation date of the date plug-in seems to be incorrectly displayed HOT 1
- Use `packaging` package for backwards compatibility check
- When building MkDocs with GitHub Actions, some warnings occured. HOT 2
- Output to top of page?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mkdocs-git-revision-date-localized-plugin.