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

do not merge test netlify previews #40

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,20 @@ jobs:
echo "Site ID $NETLIFY_SITE_ID"
npm exec -c "netlify deploy --dir $BUILD_BINARIESDIRECTORY --alias PR-${SYSTEM_PULLREQUEST_PULLREQUESTNUMBER} --json" | tee netlify.json
NETLIFY_URL=$(jq -r '.deploy_url' netlify.json)
echo "Informing GitHub about deploy url: ${NETLIFY_URL}"
curl -H "Authorization: token ${GTOKEN}" -X POST -d "{\"body\": \"[A Live Preview](${NETLIFY_URL}) of this Pull Request at commit ${SYSTEM_PULLREQUEST_SOURCECOMMITID} is now available\", \"commit_id\": \"${SYSTEM_PULLREQUEST_SOURCECOMMITID}\"}" "https://api.github.com/repos/Terracotta-OSS/terracotta.org-site/pulls/${SYSTEM_PULLREQUEST_PULLREQUESTNUMBER}/comments"
echo "##vso[task.setvariable variable=netlify_url;]${NETLIFY_URL}"
echo "Will Inform GitHub about the preview url: ${NETLIFY_URL}"
# curl -H "Authorization: token ${GTOKEN}" -X POST -d "{\"body\": \"[A Live Preview](${NETLIFY_URL}) of this Pull Request at commit ${SYSTEM_PULLREQUEST_SOURCECOMMITID} is now available\", \"commit_id\": \"${SYSTEM_PULLREQUEST_SOURCECOMMITID}\"}" "https://api.github.com/repos/Terracotta-OSS/terracotta.org-site/pulls/${SYSTEM_PULLREQUEST_PULLREQUESTNUMBER}/comments"
displayName: 'Netlify Publish'
env:
NETLIFY_SITE_ID: $(netlify_site_id)
NETLIFY_AUTH_TOKEN: $(netlify_auth_token)
GTOKEN: $(gh_token)
# GTOKEN: $(gh_token)
condition: eq(variables['Build.Reason'], 'PullRequest')
# GitHub Comment v0
# Write a comment to your GitHub entity i.e. issue or a pull request (PR).
- task: GitHubComment@0
inputs:
gitHubConnection: Terracotta-OSS
repositoryName: '$(Build.Repository.Name)' # string. Required. Repository. Default: $(Build.Repository.Name).
#id: # string. ID of the github pr/issue.
comment: "[A Live Preview]($(netlify_url)) of this Pull Request at commit $(System.PullRequest.SourceCommitId) is now available"
Loading