Gatsby.js with AWS S3 and CloudFront using GitLab CI/CD

#1

I’m building website with the gatsby.js starter Stellar. I want to integrate my gatsby project with AWS s3 + cloudfront + gitlabCI.

I have a problem with creating .gitlab-ci.yml file What does the field “export API_URL =” mean?

This is my .gitlab-ci.yml:

    image: docker:latest

        stages:
          - build
          - deploy

        build:
          stage: build
          image: node:8.11.3
          script:
              - export API_URL=" https://gitlab.example.com/api/v4/export"      
          - npm install
          - npm run build
          - echo "BUILD SUCCESSFULLY"
      artifacts:
        paths:
          - dist/
        expire_in: 20 mins
      environment:
        name: production
      only:
        - master

    deploy:
      stage: deploy
      image: python:3.5
      dependencies:
        - build
      script:
        - export AWS_ACCESS_KEY_ID=$AKIA5BKCDMCKDMCDKCMDKC       // same 
    variable we declared in gitlab CI settings
        - export 
    AWS_SECRET_ACCESS_KEY=$DKMM23K2KJ23N2K3N2K3M2K3M2K3M2KM3K
        - export S3_BUCKET_NAME=$strona-kogni
        - export DISTRIBUTION_ID=$E2Y6FG3UPMSSQ0
        - pip install awscli --upgrade --user
        - export PATH=~/.local/bin:$PATH
        - aws s3 sync --acl public-read --delete dist $strona-kogni
        - aws cloudfront create-invalidation --distribution-id 
    $E2Y6FG3UPMSSQ0 --paths '/*'
        - echo "DEPLOYED SUCCESSFULLY"
      environment:
        name: production
      only:
        - master
    ```

It's an error:

    Skipping Git submodules setup
    $ export API_URL=" https://gitlab.example.com/api/v4/export"      
    //any evnvironment variables your code requires
    /bin/bash: line 84: export: `//any': not a valid identifier
    ERROR: Job failed: exit code 1