ghcr-feat-copilot #14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |