-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (70 loc) · 2.02 KB
/
deploy-prod.yaml
File metadata and controls
73 lines (70 loc) · 2.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: Deploy Prod - Tagged Release
on:
push:
tags:
- "server/v*"
workflow_dispatch:
inputs:
tag:
description: "Tag to deploy (e.g. server/v1.2.3)"
required: true
type: string
jobs:
resolve:
runs-on: ubuntu-latest
outputs:
sha: ${{ steps.resolve.outputs.sha }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Resolve tag to commit SHA
id: resolve
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
TAG="${{ inputs.tag }}"
SHA=$(git rev-list -1 "$TAG" 2>/dev/null) || { echo "::error::Tag '$TAG' not found"; exit 1; }
echo "Resolved tag '$TAG' to SHA: $SHA"
else
SHA="${{ github.sha }}"
echo "Using event SHA: $SHA"
fi
echo "sha=$SHA" >> "$GITHUB_OUTPUT"
build:
runs-on: ubuntu-latest
needs: resolve
steps:
- name: Dispatch Build
uses: timescale/workflow-dispatch-action@main
with:
github-token: ${{ secrets.ORG_AUTOMATION_TOKEN }}
owner: timescale
repo: tiger-agents-deploy
workflow_id: build.yaml
ref: "main"
inputs: >
{
"repository": "memory-engine",
"dockerfile_path": "packages/server/Dockerfile",
"sha": "${{ needs.resolve.outputs.sha }}",
"latest": false
}
deploy:
runs-on: ubuntu-latest
needs: [resolve, build]
steps:
- name: Dispatch Deploy - prod
uses: timescale/workflow-dispatch-action@main
with:
github-token: ${{ secrets.ORG_AUTOMATION_TOKEN }}
owner: timescale
repo: tiger-agents-deploy
workflow_id: deploy.yaml
ref: "main"
inputs: >
{
"repository": "memory-engine",
"sha": "${{ needs.resolve.outputs.sha }}",
"env": "prod",
"namespace": "memory-engine"
}