Skip to content

Commit

Permalink
Use Github deployment API via plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
dannymidnight committed Nov 10, 2023
1 parent 08bc7de commit 8e233b3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .buildkite/pipeline.preview.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
env:
GITHUB_USERNAME: "buildkite-docs-bot"

steps:
- label: "Prepare preview"
command: bin/prepare-preview

- label: "Deploy preview"
command: bin/deploy-preview
plugins:
- ailohq/github-deployment#v1.0.10:
token-env: GH_TOKEN
environment: preview
production_environment: false
transient_environment: true
- docker-compose#v3.9.0:
run: app
config: docker-compose.production.yml
Expand Down
2 changes: 2 additions & 0 deletions bin/prepare-preview
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ curl -H "Content-Type: application/zip" \
PREVIEW_URL=$(cat netlify-deploy.json | jq -r '.deploy_ssl_url')
PREVIEW_MESSAGE="Preview URL: $PREVIEW_URL"

buildkite-agent meta-data set "environment_url" "$PREVIEW_URL"

echo "--- :buildkite: Annotating build"
buildkite-agent annotate --style "info" --context "netlify/preview-url" "$PREVIEW_MESSAGE"

Expand Down

0 comments on commit 8e233b3

Please sign in to comment.