Skip to content

Commit

Permalink
fix: ai-proxy-cd.yaml (#1528)
Browse files Browse the repository at this point in the history
  • Loading branch information
floreks authored Oct 29, 2024
1 parent 7401ede commit 50efb71
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 63 deletions.
118 changes: 62 additions & 56 deletions .github/workflows/ai-proxy-cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,16 @@ on:
branches:
- "master"
paths:
- ".github/workflows/ai-proxy-cd.yaml"
- "go/ai-proxy/**"
push:
branches:
- "master"
paths:
- ".github/workflows/ai-proxy-cd.yaml"
- "go/ai-proxy/**"
tags:
- 'v*.*.*'
- 'go/ai-proxy/v*.*.*'

permissions:
contents: read
Expand All @@ -28,14 +34,14 @@ jobs:
working-directory: go/ai-proxy
timeout-minutes: 5
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
go-version-file: go/ai-proxy/go.mod
cache: true
- run: go mod download
- run: PATH=$PATH:$GOPATH/bin make --directory=.. tools
- run: PATH=$PATH:$GOPATH/bin make test
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
go-version-file: go/ai-proxy/go.mod
cache: true
- run: go mod download
- run: PATH=$PATH:$GOPATH/bin make --directory=.. tools
- run: PATH=$PATH:$GOPATH/bin make test

publish-docker:
name: Build and push ai-proxy container
Expand All @@ -50,50 +56,50 @@ jobs:
id-token: 'write'
packages: 'write'
steps:
- uses: actions/[email protected]
with:
fetch-depth: 0
- id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/pluralsh/ai-proxy
gcr.io/pluralsh/ai-proxy
docker.io/pluralsh/ai-proxy
tags: |
type=sha
type=ref,event=pr
type=ref,event=branch
type=semver,pattern={{version}},priority=1000
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: google-github-actions/auth@v1
with:
workload_identity_provider: 'projects/${{ secrets.GOOGLE_PROJECT_ID }}/locations/global/workloadIdentityPools/github/providers/github'
service_account: '[email protected]'
token_format: 'access_token'
create_credentials_file: true
- uses: google-github-actions/[email protected]
- run: gcloud auth configure-docker -q
- uses: docker/login-action@v3
with:
username: mjgpluralsh
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
- uses: docker/setup-qemu-action@v3
- uses: docker/[email protected]
- uses: docker/[email protected]
with:
context: "./go/ai-proxy"
file: "./go/ai-proxy/Dockerfile"
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
GIT_COMMIT=${{ github.sha }}
VERSION=${{ steps.meta.outputs.version }}
- uses: actions/[email protected]
with:
fetch-depth: 0
- id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/pluralsh/ai-proxy
gcr.io/pluralsh/ai-proxy
docker.io/pluralsh/ai-proxy
tags: |
type=sha
type=ref,event=pr
type=ref,event=branch
type=match,pattern=go/ai-proxy/(v.*),group=1
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: google-github-actions/auth@v1
with:
workload_identity_provider: 'projects/${{ secrets.GOOGLE_PROJECT_ID }}/locations/global/workloadIdentityPools/github/providers/github'
service_account: '[email protected]'
token_format: 'access_token'
create_credentials_file: true
- uses: google-github-actions/[email protected]
- run: gcloud auth configure-docker -q
- uses: docker/login-action@v3
with:
username: mjgpluralsh
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
- uses: docker/setup-qemu-action@v3
- uses: docker/[email protected]
- uses: docker/[email protected]
with:
context: "./go/ai-proxy"
file: "./go/ai-proxy/Dockerfile"
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
GIT_COMMIT=${{ github.sha }}
VERSION=${{ steps.meta.outputs.version }}
7 changes: 0 additions & 7 deletions .github/workflows/ai-proxy-ci.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
name: CI / AI Proxy

on:
push:
branches:
- "master"
paths:
- ".github/workflows/ai-proxy-ci.yaml"
- "go/ai-proxy/**"
pull_request:
branches:
- "**"
paths:
- ".github/workflows/ai-proxy-ci.yaml"
- "go/ai-proxy/**"
-
permissions:
contents: read

Expand Down

0 comments on commit 50efb71

Please sign in to comment.