Skip to content

Commit

Permalink
Add PR deploy config (#551)
Browse files Browse the repository at this point in the history
Use doctl to get the cluster config! Then helm should be happy to
(attempt) to deploy
  • Loading branch information
Ellie Huxtable authored Aug 24, 2022
1 parent 64b7a72 commit 3f41427
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/pr-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,29 @@ jobs:
run: |
GIT_SHORT="$(git rev-parse --short HEAD)"
echo "::set-output name=git_short::${GIT_SHORT}"
echo "::set-output name=fqdn_record::${GIT_SHORT}.posthog.cc"
echo "::set-output name=fqdn_record::${GIT_SHORT}.pr.posthog.cc"
if: ${{ steps.check.outputs.has-permission && github.event.comment.body == '!deploy'}}

- name: Install doctl to access k8s config
uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}

- name: Install PostHog using the Helm chart
id: helm_install
run: |
doctl kubernetes cluster kubeconfig save $PR_CLUSTER_ID
helm upgrade --install \
-f ci/values/pr/values.yaml \
--set ingress.hostname=${{ steps.vars.outputs.fqdn_record }}
--set ingress.hostname=${{ steps.vars.outputs.fqdn_record }} \
--timeout 30m \
--create-namespace \
--namespace pr-${{ steps.vars.outputs.git_short }} \
posthog ./charts/posthog \
--wait \
--wait-for-jobs
if: ${{ steps.check.outputs.has-permission && github.event.comment.body == '!deploy'}}
env:
PR_CLUSTER_ID: ${{ secrets.PR_CLUSTER_ID }} # probably not _SECRET_, but best kept out of the YAML

0 comments on commit 3f41427

Please sign in to comment.