-
Notifications
You must be signed in to change notification settings - Fork 3
Deploy steps
We set up our project so that all scripts and raw code are located in the master
branch, while only our bundled app is located in the gh-pages
branch. We clean the version history of the gh-pages
branch on each deploy.
The basic idea is that to deploy you have cloned the gamma-sky
repo twice:
- In a directory
gamma-sky
where you are in themaster
branch and generate the files and app - In a directory
gamma-sky-deploy
where you are in thegh-pages
branch and commit and deploy the app
To refresh the data directory, in case any changes have been made, call in the root directory:
python make.py fetch all
python make.py all
With each deploy, we should change our website version so we can begin to build a version history. For now, we are editing the version
and last_modified
keys in src/data/app_info.json
by hand. In the future, we can implement a script to set new version numbers.
This step bundles files in a dist/
folder. From the master
branch, call:
ng build --target=production --aot=false --base-href ./
cd ..
git clone [email protected]:gammapy/gamma-sky.git gamma-sky-deploy
cd gamma-sky-deploy/
(Alternatively, clone into the URL version of the project: https://github.com/gammapy/gamma-sky.git
)
Otherwise:
cd ..
cd gamma-sky-deploy/
The following will wipe the contents and clear the git history in the gh-pages
branch:
git checkout gh-pages
git symbolic-ref HEAD refs/heads/gh-pages
rm .git/index
git clean -fdx
cp -r ../gamma-sky/dist/* .
git add .
git commit -m <commit message>
python -m http.server
git push -f origin gh-pages
As a final check, go check the webpage online to see if it is working properly!
It's here:
Usually it takes a minute to update, sometimes a few minutes.