doorman/.gitea/workflows/deploy-twilio.yaml
Martin Dimitrov d719014538
All checks were successful
Build and push image for doorman-homeassistant / diff (push) Successful in 1m32s
Build and push Doorman UI / API / diff (push) Successful in 11s
Build and push image for doorman-homeassistant / docker (push) Has been skipped
Build and push image for doorman-homeassistant / deploy-gitainer (push) Has been skipped
Build and push Doorman UI / API / twilio (push) Successful in 3m22s
refactor to use shared builds + secrets
2026-03-06 13:13:36 -08:00

85 lines
2.9 KiB
YAML

name: Build and push Doorman UI / API
on:
push:
branches: [main]
jobs:
diff:
uses: martin/chromart-gitea-actions/.gitea/workflows/diff-output.yaml@main
with:
files: packages/**
twilio:
needs: diff
if: ${{ needs.diff.outputs.is_changed == 'true' }}
runs-on: ubuntu-22.04
steps:
- name: Load Infisical Secrets
uses: https://gitea.chromart.cc/martin/chromart-gitea-actions/.gitea/actions/infisical-secrets@main
- uses: actions/checkout@v4
name: Check out code
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: install dependencies
run: bun install
- name: run local integration test
run: bun integ-test:local
env:
ACCOUNT_SID: ${{ env.DOORMAN_TWILIO_ACCOUNT_SID }}
AUTH_TOKEN: ${{ env.DOORMAN_TWILIO_AUTH_TOKEN }}
AWS_ACCESS_KEY: ${{ env.AWS_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ env.AWS_SECRET_ACCESS_KEY }}
DISCORD_BOT_TOKEN: ${{ env.DOORMAN_DISCORD_BOT_TOKEN }}
DISCORD_CLIENT_SECRET: ${{ env.DOORMAN_DISCORD_CLIENT_SECRET }}
- name: Deploy Doorman UI and API to staging
run: bun run deploy-serverless:staging
env:
ACCOUNT_SID: ${{ env.DOORMAN_TWILIO_ACCOUNT_SID }}
AUTH_TOKEN: ${{ env.DOORMAN_TWILIO_AUTH_TOKEN }}
# required for deploy-serverless
AWS_ACCESS_KEY: ${{ env.AWS_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ env.AWS_SECRET_ACCESS_KEY }}
DISCORD_BOT_TOKEN: ${{ env.DOORMAN_DISCORD_BOT_TOKEN }}
DISCORD_CLIENT_SECRET: ${{ env.DOORMAN_DISCORD_CLIENT_SECRET }}
STAGE: staging
DOORMAN_URL: https://doorman-6741-staging.twil.io
- name: Deploy Doorman Buzzer Client to staging
run: bun run deploy-buzzer-client:staging
env:
ACCOUNT_SID: ${{ env.DOORMAN_TWILIO_ACCOUNT_SID }}
AUTH_TOKEN: ${{ env.DOORMAN_TWILIO_AUTH_TOKEN }}
STAGE: staging
DOORMAN_URL: https://doorman-6741-staging.twil.io
- name: Wait after 15s deploy staging
run: sleep 15s
- name: run staging integration test
run: bun integ-test:staging
- name: Promote Doorman UI and API staging to prod
run: bun run deploy-serverless
env:
# promote doesn't need the keys other than twilio. it copies from staging
ACCOUNT_SID: ${{ env.DOORMAN_TWILIO_ACCOUNT_SID }}
AUTH_TOKEN: ${{ env.DOORMAN_TWILIO_AUTH_TOKEN }}
STAGE: prod
DOORMAN_URL: https://doorman.chromart.cc
- name: Promote Doorman Buzzer Client staging to prod
run: bun run deploy-buzzer-client
env:
# same for buzzer client
ACCOUNT_SID: ${{ env.DOORMAN_TWILIO_ACCOUNT_SID }}
AUTH_TOKEN: ${{ env.DOORMAN_TWILIO_AUTH_TOKEN }}
STAGE: prod
DOORMAN_URL: https://doorman.chromart.cc