-
Notifications
You must be signed in to change notification settings - Fork 1
105 lines (95 loc) · 3.01 KB
/
ci.yml
File metadata and controls
105 lines (95 loc) · 3.01 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: CI/CD
on:
push:
branches: [main, dev]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
env:
CI: "true"
NX_REJECT_UNKNOWN_LOCAL_CACHE: "0"
steps:
- uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: "1.3.11"
- name: Cache Bun install
uses: actions/cache@v4
with:
path: ~/.bun/install/cache
key: bun-${{ runner.os }}-${{ hashFiles('bun.lockb') }}
restore-keys: |
bun-${{ runner.os }}-
- name: Cache Nx
uses: actions/cache@v4
with:
path: .nx/cache
key: nx-${{ runner.os }}-${{ hashFiles('bun.lockb', 'nx.json', 'package.json') }}
restore-keys: |
nx-${{ runner.os }}-
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Run CI
run: bun run ci
- name: Run Integration Tests
if: hashFiles('tests/bin/gemini') != ''
run: |
sed -i 's/\r$//' tests/bin/gemini
chmod +x tests/bin/gemini
bun run test:integration
build-and-push:
needs: test
if: github.event_name == 'push'
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
matrix:
provider:
- key: gemini
tag: gemini
- key: claude_code
tag: claude-code
- key: openai_codex
tag: openai-codex
- key: opencode
tag: opencode
steps:
- uses: actions/checkout@v4
- name: Lowercase Repository Owner
id: repo_owner
run: echo "owner=${GITHUB_REPOSITORY_OWNER,,}" >> $GITHUB_OUTPUT
- name: Determine image tag suffix
id: tag_suffix
run: |
if [ "${{ github.ref_name }}" = "main" ]; then
echo "latest_tag=latest" >> $GITHUB_OUTPUT
else
echo "latest_tag=latest-${{ github.ref_name }}" >> $GITHUB_OUTPUT
fi
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker Setup Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
build-args: |
AGENT_PROVIDER=${{ matrix.provider.key }}
GIT_SHA=${{ github.sha }}
tags: |
ghcr.io/${{ steps.repo_owner.outputs.owner }}/phoenix-agent-oauth:${{ matrix.provider.tag }}-${{ steps.tag_suffix.outputs.latest_tag }}
ghcr.io/${{ steps.repo_owner.outputs.owner }}/phoenix-agent-oauth:${{ matrix.provider.tag }}-${{ github.sha }}
cache-from: type=gha,scope=${{ matrix.provider.key }}
cache-to: type=gha,mode=max,scope=${{ matrix.provider.key }}