diff --git a/.github/workflows/deploy-sandbox.yml b/.github/workflows/deploy-sandbox.yml index ec110836..5343b380 100644 --- a/.github/workflows/deploy-sandbox.yml +++ b/.github/workflows/deploy-sandbox.yml @@ -4,6 +4,7 @@ on: push: branches: - develop + - simon/automa-cli-build-integration jobs: deploy: @@ -25,19 +26,15 @@ jobs: key: deploy-cache-${{ hashFiles('Backend/Package.resolved') }} path: Backend/.build - - name: Get CLI Cache - uses: useblacksmith/cache@v5 - id: cli-build + - name: Get AutomaCLI + uses: GetAutomaApp/private-actions/get-automacli@main with: - key: deploy-cache-${{ hashFiles('CLI/Package.resolved') }} - path: CLI/.build + github_pat: ${{ secrets.GET_AUTOMACLI_GH_PAT }} - uses: superfly/flyctl-actions/setup-flyctl@master - run: | npm run deploy:backend:sandbox npm run deploy:worker:sandbox - ls -a Backend - ls -a CLI env: FLY_API_TOKEN: ${{ secrets.FLY_SANDBOX_API_KEY }} FLY_METRICS_TOKEN: ${{ secrets.FLY_METRICS_TOKEN }} diff --git a/.gitignore b/.gitignore index fa237e46..6bc898b4 100644 --- a/.gitignore +++ b/.gitignore @@ -202,3 +202,5 @@ wireguard-prod.conf .swiftlint.yml .swiftformat + +*.env.* diff --git a/automa.config.json b/automa.config.json new file mode 100644 index 00000000..a06b572f --- /dev/null +++ b/automa.config.json @@ -0,0 +1,16 @@ +{ + "fly" : { + "environments" : [ + "production", + "sandbox", + "staging" + ], + "config_files_root" : "Backend/infra/fly" + }, + "actionsSecrets" : { + "owner_repo" : "GetAutomaApp/AutomaInfraCore" + }, + "grafana" : { + "current_environment" : "automa-grafana" + } +} diff --git a/package.json b/package.json index 98c51e86..988c64ac 100644 --- a/package.json +++ b/package.json @@ -7,15 +7,15 @@ "cli:docker": "docker exec -ti backend-app_dev-1 ./.build/aarch64-unknown-linux-gnu/debug/App --env local", "prepare:action": "npm install", "generate": "npm run cli -- generate", - "cli": "cd CLI && swift run AutomaCLI", - "fly:config": "npm run cli -- fly-config", + "cli": "automa", + "fly:config": "npm run generate -- fly", "format": "swiftformat .", - "deploy:backend:sandbox": "npm run fly:config -- ../Backend/infra/fly/fly.toml sandbox | npm run deploy:to:fly", - "deploy:backend:staging": "npm run fly:config -- ../Backend/infra/fly/fly.toml staging | npm run deploy:to:fly", - "deploy:backend:production": "npm run fly:config -- ../Backend/infra/fly/fly.toml production | npm run deploy:to:fly", + "deploy:backend:sandbox": "npm run fly:config -- fly sandbox | npm run deploy:to:fly", + "deploy:backend:staging": "npm run fly:config -- fly staging | npm run deploy:to:fly", + "deploy:backend:production": "npm run fly:config -- fly production | npm run deploy:to:fly", "deploy:to:fly": "tail -n 1 | xargs -Ixx cp xx Backend/.fly.toml && cd Backend && flyctl deploy --config=.fly.toml", - "deploy:worker:sandbox": "npm run fly:config -- ../Backend/infra/fly/fly-jobs.toml sandbox | npm run deploy:to:fly", - "deploy:worker:production": "npm run fly:config -- ../Backend/infra/fly/fly-jobs.toml production | npm run deploy:to:fly", + "deploy:worker:sandbox": "npm run fly:config -- fly-jobs sandbox | npm run deploy:to:fly", + "deploy:worker:production": "npm run fly:config -- fly-jobs production | npm run deploy:to:fly", "build:all": "npx npm-run-all --parallel build:ui-kit build:backend", "build:ui-kit": "cd App/AutomaUIKit && swift build", "build:backend": "cd Backend && swift build",