Issue in terminal after you authenticated with surge:
surge token
and the token will be generated. Keep it safe.image: node
stages:
- build
- test
- deploy
- deployment test
build website:
stage: build
script:
- npm install
- npm install -g gatsby-cli
- gatsby build
artifacts:
paths:
- ./public
test artifact:
image: alpine
stage: test
script:
- grep -q "Gatsby" ./public/index.html
test website:
stage: test
script:
- npm install
- npm install -g gatsby-cli
- gatsby serve &
- sleep 5
- curl "http://localhost:9000" | tac | tac | grep -q "Gatsby"
deploy to surge:
stage: deploy
script:
- npm install --global surge
- surge --project ./public --domain pctags2.surge.sh
test deployment:
stage: deployment test
image: alpine
script:
- apk add --no-cache curl
- curl -s "https://pctags2.surge.sh" | tac | tac | grep -q "Gatsby"