Skip to content

Commit

Permalink
chore(ci): add build ci
Browse files Browse the repository at this point in the history
Signed-off-by: Rintaro Okamura <[email protected]>
  • Loading branch information
rinx committed Jun 25, 2024
1 parent ea52f07 commit ea6c5de
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: "Build binaries"

on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
attestations: write
strategy:
matrix:
os:
- linux
- darwin
arch:
- arm64
- amd64
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Build
env:
GOOS: ${{ matrix.os }}
GOARCH: ${{ matrix.arch }}
run: |
go build -o gcloud-auth-proxy_${{ matrix.os }}_${{ matrix.arch }} ./cmd/proxy
- name: Upload
uses: actions/upload-artifact@v4
with:
name: gcloud-auth-proxy_${{ matrix.os }}_${{ matrix.arch }}
path: gcloud-auth-proxy_${{ matrix.os }}_${{ matrix.arch }}
41 changes: 41 additions & 0 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: "Build container images"

on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Extrace short sha
id: short-sha
run: |
echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Setup QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: all
- name: Setup Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push
uses: docker/build-push-action@v5
with:
push: true
tags: |
ghcr.io/rinx/gcloud-auth-proxy:latest
ghcr.io/rinx/gcloud-auth-proxy:${{ steps.short-sha.outputs.sha }}
platforms: linux/amd64,linux/arm64
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ TBW
|------------------|--------|------------------|
| `/idtoken` | POST | returns ID Token |
| `/idtoken/proxy` | | forwards HTTP request and appends ID Token to its header |
| `/healthz` | | health check endpoint |
| `/readyz` | | readiness check endpoint |

## Similar Projects

Expand Down

0 comments on commit ea6c5de

Please sign in to comment.