Deploy a Git application from CI with TatNet CLI
TatNet CLI can trigger a build of an existing Git application and wait until the exact pushed commit is live. Русская версия.
Prepare
Create a TatNet app connected to the same GitHub repository and main branch. If CI should be the only deploy trigger, disable automatic deployment on push. Store a scoped API key in the GitHub Actions secret TATNET_API_KEY. Set repository variables TATNET_APP_ID (app UUID) and TATNET_CLI_VERSION (a tested npm version).
GitHub Actions workflow
Save this as .github/workflows/tatnet-deploy.yml:
name: Deploy to TatNet
on:
push:
branches: [main]
permissions:
contents: read
concurrency:
group: tatnet-production
cancel-in-progress: false
jobs:
deploy:
runs-on: ubuntu-latest
timeout-minutes: 35
steps:
- uses: actions/setup-node@v7
with:
node-version: '24'
package-manager-cache: false
- name: Install TatNet CLI
env:
CLI_VERSION: ${{ vars.TATNET_CLI_VERSION }}
run: |
test -n "$CLI_VERSION"
npm install -g "tatnet@$CLI_VERSION"
- name: Deploy the pushed commit and wait for live
env:
TATNET_API_KEY: ${{ secrets.TATNET_API_KEY }}
APP_ID: ${{ vars.TATNET_APP_ID }}
run: |
test -n "$TATNET_API_KEY"
test -n "$APP_ID"
tatnet app deploy "$APP_ID" --commit "$GITHUB_SHA" --wait --logs
No checkout is necessary: TatNet builds the Git repository. Authentication uses the environment variable; no interactive login is required. The CLI version is pinned by your repository variable. The example follows the setup-node usage guide.
Verify
The command succeeds only when its selected build has status=success and deploy_state=live. A build or startup failure, or a timeout, returns a nonzero exit code. Logs go to stderr.
To observe an already-triggered build without launching another one:
tatnet app wait <app-id> --commit <full-SHA> --deadline 30m
Test the workflow on a test application before using it for production. Resources follow TatNet pricing. For uploads from a local directory, see CLI deployment.