-
Notifications
You must be signed in to change notification settings - Fork 366
70 lines (67 loc) · 2.37 KB
/
build-docker.yaml
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
name: Build Docker
on:
push:
branches: [ "**" ]
tags: [ "**" ]
paths-ignore:
- ".devcontainer/**"
- ".github/**"
- "!.github/workflows/build-docker.yaml"
- ".vscode/**"
- "docs/**"
- "**.md"
pull_request:
branches: [ "main" ]
paths-ignore:
- ".devcontainer/**"
- ".github/**"
- "!.github/workflows/build-docker.yaml"
- ".vscode/**"
- "docs/**"
- "**.md"
workflow_dispatch:
env:
SERVER_IMAGE_NAME: ten_agent_server
PLAYGROUND_IMAGE_NAME: ten_agent_playground
DEMO_IMAGE_NAME: ten_agent_demo
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-tags: true
fetch-depth: "0"
- id: pre-step
shell: bash
run: echo "image-tag=$(git describe --tags --always)" >> $GITHUB_OUTPUT
- name: Build & Publish Docker Image for Agents Server
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: ${{ github.repository_owner }}/${{ env.SERVER_IMAGE_NAME }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
tags: "${{ github.ref == 'refs/heads/main' && 'latest,' || '' }}${{ steps.pre-step.outputs.image-tag }}"
no_push: ${{ github.event_name == 'pull_request' }}
- name: Build & Publish Docker Image for Playground
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: ${{ github.repository_owner }}/${{ env.PLAYGROUND_IMAGE_NAME }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
workdir: playground
tags: "${{ github.ref == 'refs/heads/main' && 'latest,' || '' }}${{ steps.pre-step.outputs.image-tag }}"
no_push: ${{ github.event_name == 'pull_request' }}
- name: Build & Publish Docker Image for demo
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: ${{ github.repository_owner }}/${{ env.DEMO_IMAGE_NAME }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
workdir: demo
tags: "${{ github.ref == 'refs/heads/main' && 'latest,' || '' }}${{ steps.pre-step.outputs.image-tag }}"
no_push: ${{ github.event_name == 'pull_request' }}