-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into vg/feat/storage-fallback
- Loading branch information
Showing
27 changed files
with
3,919 additions
and
373 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
name: Build and publish catalyst-api docker images | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
- dev | ||
tags: | ||
- "v*" | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
docker: | ||
name: Build and publish docker image | ||
runs-on: ubuntu-latest | ||
permissions: | ||
packages: write | ||
contents: read | ||
|
||
steps: | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.CI_DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.CI_DOCKERHUB_TOKEN }} | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ github.token }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: | | ||
livepeerci/${{ github.event.repository.name }} | ||
ghcr.io/${{ github.repository }} | ||
tags: | | ||
type=sha | ||
type=ref,event=pr | ||
type=ref,event=tag | ||
type=sha,format=long | ||
type=ref,event=branch | ||
type=semver,pattern={{version}},prefix=v | ||
type=semver,pattern={{major}}.{{minor}},prefix=v | ||
type=raw,value=latest,enable={{is_default_branch}} | ||
type=raw,value=${{ github.event.pull_request.head.ref }} | ||
type=raw,value=stable,enable=${{ startsWith(github.event.ref, 'refs/tags/v') }} | ||
- name: Build and push | ||
uses: docker/build-push-action@v4 | ||
with: | ||
platforms: linux/amd64, linux/arm64 | ||
push: true | ||
build-args: | | ||
GIT_VERSION=${{ github.ref_type == 'tag' && github.ref_name || github.event.pull_request.head.sha || github.sha }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
|
||
- name: Notify new build upload | ||
run: curl -X POST https://holy-bread-207a.livepeer.workers.dev |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
FROM golang:1-bullseye as gobuild | ||
|
||
ARG TARGETARCH | ||
|
||
WORKDIR /src | ||
|
||
ADD go.mod go.sum ./ | ||
RUN go mod download | ||
|
||
ADD . . | ||
RUN make build | ||
|
||
ARG GIT_VERSION | ||
ENV GIT_VERSION="${GIT_VERSION}" | ||
|
||
FROM ubuntu:22.04 AS catalyst | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
LABEL maintainer="Amritanshu Varshney <[email protected]>" | ||
|
||
ARG BUILD_TARGET | ||
|
||
RUN apt update && apt install -yqq wget software-properties-common | ||
|
||
RUN apt update && apt install -yqq \ | ||
curl \ | ||
ca-certificates \ | ||
procps \ | ||
vnstat \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
COPY --from=gobuild /src/build/catalyst-api /bin/catalyst-api | ||
|
||
CMD ["/bin/catalyst-api"] |
This file contains 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
This file contains 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
Oops, something went wrong.