Coder Social home page Coder Social logo

Comments (6)

fertek avatar fertek commented on June 26, 2024 2

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.

timvink avatar timvink commented on June 26, 2024 1

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 avatar segg21 commented on June 26, 2024 1

@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.

jdguillot avatar jdguillot commented on June 26, 2024 1

@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.

segg21 avatar segg21 commented on June 26, 2024

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.

jdguillot avatar jdguillot commented on June 26, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.