travis ci variables not accessible from .travis-ci.yml

I am trying to deploy the build to gh pages from travis ci. But, I am not able to access the variables from within the git commands, otherwise the variables are accessible when simply trying to echo them.

jobs: include: - stage: "lint" name: "Check for code smell" script: yarn lint - stage: "deploy" name: "Deploy to GH Pages" script: - git config --global ${Name} - git config --global ${Email} - git remote rm origin - git remote add origin https://linux-nerd:${GITHUB_TOKEN}@${GH_REF} - yarn run deploy - echo ${Email} - echo $Email - echo https://linux-nerd:${GITHUB_TOKEN}@${GH_REF}

The last three echos are printing correctly, but the git commands do not take the correct values.

What am I missing?

1 answer

  • answered 2018-11-08 06:49 AppleCiderGuy

    this is how I configure git user and email:

    git config --global "username"
    git config --global "email"

    Please not the use of "" above

    thats what u are missing in your file