mirror of
https://github.com/PostHog/posthog.git
synced 2024-11-22 17:24:15 +01:00
59eaa99c14
* 🔥 initial commit * update readme * Update README.md * Update README.md * deploy scripts * very basic consumer setup * add some configs and docker-compose * formatting for testing * add tailscale * flip from dev to prod flag * set default to be not prod * default for group_id * tailscale up * update gitignore * basic geolocation * remove unused localServer * document mmdb * just make configs an example * drop raw print * add a start script (downloads the mmdb) * add readme and update configs.example * ts working * if in start * update start script * fix start * fix start * fix more * add sql endpoints for tokenId and Person lookups * work towards filter * sub channel * fix subChan * hardcode team2 token * add cors * only allow get and head * add atomicbool * add channel to kafka * add logs * verbose logs * make array * drop sub ptrs * more logs * helps to loop * drop some logigng * move sub branch * logging * drop log * hog * Deal with numeric distinct ids later * logs * api_key * send 1/1000 * remove log * remove more logs * change response payload * set timestamp if needed * fill in person_id if team_id is set * require teamid, convert to token * clean up subs on disconnect * log * check for token in another place * clean up subs on disconnect * drop modulo and log * fix no assign * don't reuse db conn for now * drop a log * add back commented out log * Don't block on send to client channel * add geo bool * only geo events * use wrapper ip * don't require team in geo mode * add an endpoint and stats keeper for teams * remove stats keeper * start stats keeper * wire it up * change the shape of the response * omit empty error * omit empty on the stats as well * enable logging on back pressure * add jwt endpoint for testing * support multiple event types * Get Auth Setup * jwt team is float so turn that into int * logs * add auth for stats endpoint * remove tailscale and use autoTLS on public endpoints * default to :443 for auto tls * remove un-needed endpoints and handlers * Use compression because... a lot of data (#9) * add dockerfile and CI/CD (#10) * add dockerfile and CI/CD * Use ubuntu not alpine couldn't build in alpine :'( * Add MMDB download to Dockerfile (#11) * Use clearer name for MMDB * Don't connect to Kafka over SSL in dev * Fix JWT token in example config * Add postgres.url to example config * Add expected scope * Fix const syntax * Put scope validation where claims are known * Fix audience validation * moves * ignore livestream for ci * main -> master * move GA to root * docker lint fix * fix typo * fixes for docker builds * test docker build * livestream build docker * dang * Update .github/workflows/livestream-docker-image.yml Co-authored-by: Neil Kakkar <neilkakkar@gmail.com> * Update .github/workflows/livestream-docker-image.yml Co-authored-by: Neil Kakkar <neilkakkar@gmail.com> * don't build posthog container when PR is pushed for rust or livestream * Update .github/workflows/livestream-docker-image.yml Co-authored-by: Neil Kakkar <neilkakkar@gmail.com> * add a lot of paths-ignore * Update .github/workflows/livestream-docker-image.yml Co-authored-by: Neil Kakkar <neilkakkar@gmail.com> * Dorny filters are handling most of what I was trying to do * remove tailscale to speed up builds * maybe? * push container to github.com/posthog/postog * don't build container on PR * remove more filters because dorny --------- Co-authored-by: Brett Hoerner <brett@bretthoerner.com> Co-authored-by: Zach Waterfield <zlwaterfield@gmail.com> Co-authored-by: Frank Hamand <frankhamand@gmail.com> Co-authored-by: Michael Matloka <michal@matloka.com> Co-authored-by: Neil Kakkar <neilkakkar@gmail.com>
76 lines
2.5 KiB
YAML
76 lines
2.5 KiB
YAML
name: Container Images CI
|
|
|
|
on:
|
|
pull_request:
|
|
paths-ignore:
|
|
- 'rust/**'
|
|
- 'livestream/**'
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
posthog_build:
|
|
name: Build Docker image
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
id-token: write # allow issuing OIDC tokens for this workflow run
|
|
contents: read # allow at least reading the repo contents, add other permissions if necessary
|
|
|
|
steps:
|
|
# If this run wasn't initiated by PostHog Bot (meaning: snapshot update),
|
|
# cancel previous runs of snapshot update-inducing workflows
|
|
|
|
- uses: n1hility/cancel-previous-runs@v3
|
|
if: github.actor != 'posthog-bot'
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
workflow: .github/workflows/storybook-chromatic.yml
|
|
|
|
- uses: n1hility/cancel-previous-runs@v3
|
|
if: github.actor != 'posthog-bot'
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
workflow: .github/workflows/ci-backend.yml
|
|
|
|
- name: Check out
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Build and cache Docker image in Depot
|
|
uses: ./.github/actions/build-n-cache-image
|
|
with:
|
|
actions-id-token-request-url: ${{ env.ACTIONS_ID_TOKEN_REQUEST_URL }}
|
|
|
|
deploy_preview:
|
|
name: Deploy preview environment
|
|
uses: ./.github/workflows/pr-deploy.yml
|
|
needs: [posthog_build]
|
|
secrets: inherit
|
|
if: ${{ contains(github.event.pull_request.labels.*.name, 'deploy') }}
|
|
|
|
lint:
|
|
name: Lint changed Dockerfiles
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check out
|
|
uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Check if any Dockerfile has changed
|
|
id: changed-files
|
|
uses: tj-actions/changed-files@v43
|
|
with:
|
|
files: |
|
|
**/Dockerfile
|
|
**/*.Dockerfile
|
|
**/Dockerfile.*
|
|
separator: ' '
|
|
|
|
- name: Lint changed Dockerfile(s) with Hadolint
|
|
uses: jbergstroem/hadolint-gh-action@v1
|
|
if: steps.changed-files.outputs.any_changed == 'true'
|
|
with:
|
|
dockerfile: '${{ steps.changed-files.outputs.all_modified_files }}'
|