Last active
September 25, 2020 20:58
-
-
Save Deborah-Digges/41a4775a088c66960146c5dc10f1c232 to your computer and use it in GitHub Desktop.
gatsby-deploy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
language: node_js | |
before_script: | |
- npm install -g gatsby-cli | |
node_js: | |
- "10" | |
script: git config --global user.email $GH_EMAIL 2> /dev/null && | |
git config --global user.name $GH_USERNAME 2> /dev/null && | |
git remote set-url origin "https://${GH_USERNAME}:${GH_TOKEN}@github.com/deborah-digges/deborah-digges.github.io.git" 2> /dev/null && | |
yarn install && yarn run deploy 2> /dev/null | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git config --global user.name $GH_USERNAME | |
git config --global user.email $GH_EMAIL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git remote set-url origin "https://${GH_USERNAME}:${GH_TOKEN}@github.com/deborah-digges/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git checkout -b gh-pages | |
gatsby build | |
# Temporarily move the public folder | |
mv public /tmp | |
# Remove all other files | |
rm -r * | |
# Move the contents of the public folder back to the root of the directory | |
cp -r /tmp/public/* . | |
git commit -m "Release new version of blog" | |
git push origin gh-pages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"scripts": { | |
... | |
"build": "gatsby build", | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
... | |
"homepage": "deborah-digges.github.io", | |
... | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"scripts": { | |
"build": "gatsby build", | |
"deploy": "npm run build && gh-pages -d public", | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
➜ cd public | |
➜ http-server | |
Starting up http-server, serving ./ | |
Available on: | |
http://127.0.0.1:8082 | |
http://10.10.10.10:8082 | |
http://192.168.13.12:8082 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yarn add gh-pages |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment