0
votes

The website was created with Gatsby.JS as the presentation layer and headless WordPress as a repository for blog entries.

The WP Github Trigger plugin was used to rebuild the page after adding an entry in WordPress, which sends a notification to Github at the event of saving the post and activates the process of building the project and sending it to the website server.

When I started GitHub action I get the log:

error  gatsby-source-wordpress  connect ETIMEDOUT xx.xx.xx.xx:80 

GraphQL request to http://example.com/graphql failed.

Please ensure the following statements are true 
  - your WordPress URL is correct in gatsby-config.js
  - your server is responding to requests 
  - WPGraphQL and WPGatsby are installed in your WordPress backend
not finished createSchemaCustomization - 260.923s

My gatsby-config.js file:

const isDev = process.env.NODE_ENV === `development`;

require('dotenv').config({
  path: `.env.${isDev ? 'development' : 'production'}`,
});


module.exports = {
  siteMetadata: {
    title: `xxx`,
    description: `xxx`,
    author: `xxx`,
    client: {
      fullName: 'xxx',
      profession: 'xxx',
      telephone: 'xxx',
      email: 'xxxx',
      address: {
        street: 'xxxx',
        city: 'xxx',
      },
    },
  },
  plugins: [
    `gatsby-plugin-react-helmet`,
    {
      resolve: `gatsby-source-filesystem`,
      options: {
        name: `images`,
        path: `${__dirname}/src/images`,
      },
    },
    `gatsby-transformer-sharp`,
    `gatsby-plugin-sharp`,
    {
      resolve: `gatsby-plugin-manifest`,
      options: {
        name: `gatsby-starter-default`,
        short_name: `starter`,
        start_url: `/`,
        background_color: `#012501`,
        theme_color: `#012501`,
        display: `minimal-ui`,
        icon: `src/images/favicon-32x32.png`, 
      },
    },
    {
      resolve: 'gatsby-source-wordpress-experimental',
      options: {
        url: process.env.WPGRAPHQL_URL, // this URL is correct (xxx.com/graphql endpoint)
        schema: {
          typePrefix: `Wp`,
        },
        develop: {
          hardCacheMediaFiles: true,
        },
        type: {
          Post: {
            limit: isDev ? 50 : 5000,
          },
        },
      },
    },
    {
      resolve: 'gatsby-plugin-react-svg',
      options: {
        rule: {
          include: /images/,
        },
      },
    },
    {
      resolve: `gatsby-plugin-styled-components`,
      options: isDev ? { displayName: true } : undefined,
    },
    {
      resolve: `gatsby-plugin-scroll-reveal`,
      options: {
        threshold: 0.001, 
        once: true, 
        disable: false, 
        selector: '[data-sal]', 
        rootMargin: '0% 10%', 

      },
    },
  ],
};

It's my first site created with Gatsby (such was the need of the person for whom I do it).

At first I thought it was a problem with ip access, but despite being added to allowlist, it didn't help.

Do you have any idea what could be causing the error?

2

2 Answers

1
votes

You can change your develop running command to, in your package.json:

"develop": "GATSBY_CONCURRENT_DOWNLOAD=5 gatsby develop",

That should do the trick.

0
votes

@Ferran thank you, it's working!

But I have new error:

Unexpected input(s) 'remoteDirectories', valid inputs are ['entryPoint', 'args', 'host', 'user', 'password', 'remoteFiles', 'workingDir', 'ignoreSSL']

My ci.yml file:

name: CI
on:
  workflow_dispatch:
  repository_dispatch:
    types: [wordpress]

jobs:
  Build-And-Deploy:
    name: Build Gatsby Site
    runs-on: ubuntu-latest
    steps:
    - name: Checkout repository
      uses: actions/checkout@master
    - name: Build Gatsby Site
      uses: jzweifel/gatsby-cli-github-action@master
      with:
        gatsby-arg: build    
    - name: Clean previous Gatsby release 
      uses: StephanThierry/[email protected]
      with:
        host: ${{ secrets.FTP_SERVER }}
        user: ${{ secrets.FTP_USERNAME }}
        password: ${{ secrets.FTP_PASSWORD }}
        remoteFiles: "*.js;*.js.map;manifest.webmanifest;*.LICENSE.txt;*.css;"
        remoteDirectories: "static;page-data"
        workingDir: "/public_html"
        ignoreSSL: "1"
    - name: Deploy app
      uses: isthatcentered/dist-to-ftp@master
      with:
        host: ${{ secrets.FTP_SERVER }}
        user: ${{ secrets.FTP_USERNAME }}
        password: ${{ secrets.FTP_PASSWORD }}
        path: "public"
        into: "/public_html"
        cleanupExisting: false

Maybe is just problem with name of "remoteDirectories"?