Skip to content

Commit 08a8352

Browse files
authored
Merge pull request #5 from conversun/ci/ghcr-feat-copilot-on-main
ci(ghcr): mirror ghcr-feat-copilot workflow on main for dispatch resolution
2 parents 41ffcac + 86832a6 commit 08a8352

1 file changed

Lines changed: 60 additions & 0 deletions

File tree

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: ghcr-feat-copilot
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- feat/copilot
8+
9+
env:
10+
IMAGE: ghcr.io/${{ github.repository_owner }}/cli-proxy-api
11+
12+
jobs:
13+
build-and-push:
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
packages: write
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
22+
- name: Refresh models catalog
23+
run: |
24+
git fetch --depth 1 https://github.com/router-for-me/models.git main
25+
git show FETCH_HEAD:models.json > internal/registry/models/models.json
26+
27+
- name: Set up Docker Buildx
28+
uses: docker/setup-buildx-action@v3
29+
30+
- name: Login to GHCR
31+
uses: docker/login-action@v3
32+
with:
33+
registry: ghcr.io
34+
username: ${{ github.actor }}
35+
password: ${{ secrets.GITHUB_TOKEN }}
36+
37+
- name: Lowercase image name
38+
run: echo "IMAGE=$(echo '${{ env.IMAGE }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
39+
40+
- name: Generate Build Metadata
41+
run: |
42+
echo "VERSION=feat-copilot" >> $GITHUB_ENV
43+
echo "COMMIT=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
44+
echo "BUILD_DATE=$(date -u +%Y-%m-%dT%H:%M:%SZ)" >> $GITHUB_ENV
45+
46+
- name: Build and push (amd64)
47+
uses: docker/build-push-action@v6
48+
with:
49+
context: .
50+
platforms: linux/amd64
51+
push: true
52+
build-args: |
53+
VERSION=${{ env.VERSION }}
54+
COMMIT=${{ env.COMMIT }}
55+
BUILD_DATE=${{ env.BUILD_DATE }}
56+
tags: |
57+
${{ env.IMAGE }}:feat-copilot
58+
${{ env.IMAGE }}:feat-copilot-${{ env.COMMIT }}
59+
cache-from: type=gha
60+
cache-to: type=gha,mode=max

0 commit comments

Comments
 (0)