Deploy script
This commit is contained in:
		
							parent
							
								
									4528beadd6
								
							
						
					
					
						commit
						9be61226ae
					
				
					 2 changed files with 27 additions and 1 deletions
				
			
		
							
								
								
									
										2
									
								
								.gitignore
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.gitignore
									
										
									
									
										vendored
									
									
								
							|  | @ -1,2 +1,2 @@ | |||
| public/ | ||||
| deploy/ | ||||
| .deploy/ | ||||
|  |  | |||
							
								
								
									
										26
									
								
								deploy.sh
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										26
									
								
								deploy.sh
									
										
									
									
									
										Executable file
									
								
							|  | @ -0,0 +1,26 @@ | |||
| #!/bin/sh | ||||
| 
 | ||||
| if [ "`git status -s`" ] | ||||
| then | ||||
|     echo "The working directory is dirty. Please commit any pending changes." | ||||
|     exit 1; | ||||
| fi | ||||
| 
 | ||||
| echo "Deleting old publication" | ||||
| rm -rf .deploy | ||||
| mkdir .deploy | ||||
| git worktree prune | ||||
| rm -rf .git/worktrees/-deploy/ | ||||
| 
 | ||||
| echo "Checking out gh-pages branch into public" | ||||
| git worktree add -B gh-pages .deploy origin/gh-pages | ||||
| 
 | ||||
| echo "Generating site" | ||||
| zola build | ||||
| cp -r public/* .deploy/ | ||||
| 
 | ||||
| echo "Updating gh-pages branch" | ||||
| cd .deploy && git add --all && git commit -m "Publishing to gh-pages (deploy.sh)" | ||||
| 
 | ||||
| echo "Pushing to github" | ||||
| git push --all | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue