-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update azure-pipelines-1.yml for Azure Pipelines
Adding the deploy stage following: https://cloudblogs.microsoft.com/opensource/2019/04/05/publishing-github-pages-from-azure-pipelines/
- Loading branch information
1 parent
0a66fea
commit c2a84eb
Showing
1 changed file
with
21 additions
and
10 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,15 +28,26 @@ steps: | |
|
||
- bash: | | ||
git submodule update --init --recursive | ||
pwd | ||
ls -la | ||
./hugo -t hugo-coder -d docs | ||
displayName: "Add submodule and run hugo" | ||
|
||
- bash: | | ||
git config --local user.name "Azure Pipelines" | ||
git config --local user.email "[email protected]" | ||
git status | ||
git add docs | ||
git commit -m "CD after merge in blog branch $(date)" | ||
git log | ||
git show | ||
displayName: "Git commit and push" | ||
|
||
git commit -m "CD after merge in blog branch $(date) ***NO_CI***" | ||
displayName: "Add submodule, run hugo and commit" | ||
|
||
- task: DownloadSecureFile@1 | ||
inputs: | ||
secureFile: blog_rsa | ||
displayName: 'Get the deploy key' | ||
|
||
- script: | | ||
mkdir ~/.ssh && mv $DOWNLOADSECUREFILE_SECUREFILEPATH ~/.ssh/id_rsa | ||
chmod 700 ~/.ssh && chmod 600 ~/.ssh/id_rsa | ||
ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts | ||
git remote set-url --push origin [email protected]:NissesSenap/blog.git | ||
git push origin HEAD:master | ||
displayName: 'Publish GitHub Pages' | ||
condition: | | ||
and(not(eq(variables['Build.Reason'], 'PullRequest')), | ||
eq(variables['Build.SourceBranch'], 'refs/heads/master')) |