Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploying automatically to our production website #5

Open
jurra opened this issue Mar 16, 2020 · 2 comments
Open

Deploying automatically to our production website #5

jurra opened this issue Mar 16, 2020 · 2 comments
Assignees

Comments

@jurra
Copy link
Contributor

jurra commented Mar 16, 2020

Continuous integration and deployment works fine in the ohlwebsite.
Andre and I found an issue with regard to the domain name itself. I can recall the details but I think is in an older issue.

The current solution

Commit changes and automatically push to the current production website.

Setup this following these steps:

  1. Go to .git\hooks folder in your local ohlwebsite repository. Make sure to unhide these folder if is hidden.
  2. Go to post-commit file and replace its current code with the following code:
#!/bin/sh

# abort on errors
# set -e

# load .env
# eval "$(cat .env <(echo) <(declare -x))"

# build
npm run build

# navigate into the build output directory
cd dist

# if you are deploying to a custom domain
# echo 'www.example.com' > CNAME

git init

echo "openhardware4.me" > CNAME

git add -A
git commit -m 'deploy'

git push -f https://github.com/Open-Hardware-Leaders/open-hardware-leaders.github.io.git master

cd -

git push origin
  1. (Recommended but not compulsory for now) Test your change also locally running npm start.
  2. Make your commits normally and the production repo will be updated automatically.
@vektorious
Copy link
Contributor

vektorious commented Mar 20, 2020

In my .git/hooks folder is just README.sample.
I guess I have to create a new file then?

@jurra
Copy link
Contributor Author

jurra commented Mar 20, 2020

yes new file called post-commit.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants