diff --git a/.github/workflows/ghcr-feat-copilot.yml b/.github/workflows/ghcr-feat-copilot.yml new file mode 100644 index 0000000000..c4167dd2cf --- /dev/null +++ b/.github/workflows/ghcr-feat-copilot.yml @@ -0,0 +1,60 @@ +name: ghcr-feat-copilot + +on: + workflow_dispatch: + push: + branches: + - feat/copilot + +env: + IMAGE: ghcr.io/${{ github.repository_owner }}/cli-proxy-api + +jobs: + build-and-push: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Refresh models catalog + run: | + git fetch --depth 1 https://github.com/router-for-me/models.git main + git show FETCH_HEAD:models.json > internal/registry/models/models.json + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to GHCR + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Lowercase image name + run: echo "IMAGE=$(echo '${{ env.IMAGE }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV + + - name: Generate Build Metadata + run: | + echo "VERSION=feat-copilot" >> $GITHUB_ENV + echo "COMMIT=$(git rev-parse --short HEAD)" >> $GITHUB_ENV + echo "BUILD_DATE=$(date -u +%Y-%m-%dT%H:%M:%SZ)" >> $GITHUB_ENV + + - name: Build and push (amd64) + uses: docker/build-push-action@v6 + with: + context: . + platforms: linux/amd64 + push: true + build-args: | + VERSION=${{ env.VERSION }} + COMMIT=${{ env.COMMIT }} + BUILD_DATE=${{ env.BUILD_DATE }} + tags: | + ${{ env.IMAGE }}:feat-copilot + ${{ env.IMAGE }}:feat-copilot-${{ env.COMMIT }} + cache-from: type=gha + cache-to: type=gha,mode=max