1

I am deploying through Netlify.

Deploy preview links are only ever directed to the live, published site. According to Decap's deploy preview docs, it should work automatically with my setup and CMS version. When I enable editorial workflow, save changes from the CMS and check for preview on a specific entry, I do see the 'View Preview' link. However, this does not direct me to deploy-preview-20--example.com as would be expected, but simply to example.com. I tried using the original netlify-assigned url instead of my custom domain in the site_url entry for the config, and the same happens. I have tried using Git Gateway instead of Gitlab with oauth, and the same happens. What am i missing to pass the real generated URL for the deploy preview back to Decap?

In my repo, I can see that there is a new branch created for the commit after saving an edit. I can also go into the 'Deploys' section of my Netlify UI. If I open the deploy preview from there, I see the saved changes reflected in the content. So everything seems to be working, barring the fact that my 'View Deploy' button in my CMS UI is not linked to the actual preview url.

Here are the relevant parts of my Decap config, using example URLs and sections:

backend:
  name: gitlab
  repo: repo-owner/reponame
  app_id: # app-id-here
  auth_type: pkce
  branch: main # Branch to update (optional; defaults to master)s

media_folder: 'static/images/'
public_folder: '/images/'
publish_mode: editorial_workflow
display_url: "https://example.com/"
site_url: "https://example.com/"

collections:
  - label: "Homepage"
    name: "home"
    files:
      - label: "Hero Section"
        name: "intro"
        file: path/to/file.md
        preview_path: "/"
        fields:
          # some fields here
   - label: "Contact Page"
     name: "contact"
     preview_path: "contact-us"
     files:
       - label: 'Intro'
          name: intro
          file: path/to/file.md
          fields:
              # some fields here

I know there was a similar question up, but it had no replies, and I'm really hoping for some advice.

4
  • 1
    does not sound like a git question
    – eftshift0
    Commented Mar 4 at 14:09
  • "I can also go into the 'Deploys' section of my Netlify UI. If I open the deploy preview from there" – what's the URL of the working preview? I'm pretty sure it's of the form deploy-preview-123--siteone.netlify.app (and not with your custom domain). But the question still remains then how DecapCMS receives this url. For GitHub, there is the Statuses API. But similarly it should "just work" for GitLab, starting from DecapCMS 2.10.6, you sure you're using the newest version?
    – mb21
    Commented Mar 4 at 14:45
  • @mb21 I'm using decap-cms-app 3.1.2 and decap-cms-core 3.3.2. This is a SvelteKit project so I installed the CMS as an npm package. (now I'm starting to wonder if it will work if I use it from the CDN instead - but everything else works as expected.) And yes, you are correct about the form of the deploy preview URL, but I have no idea how the CMS is supposed to receive this URL since according to the docs it should work automatically.
    – leactz
    Commented Mar 5 at 9:20
  • 1
    yeah, maybe a bug? perhaps you can see requests to the GitLab API in your browser's network dev tools. You're not self-hosting GitLab or anything special, right? Otherwise I'd file an issue. Seems it's implemented here
    – mb21
    Commented Mar 5 at 9:43

0

Browse other questions tagged or ask your own question.