Skip to content

Commit

Permalink
docker: Build images for ghcr.io registry. (#188)
Browse files Browse the repository at this point in the history
  • Loading branch information
hjpotter92 authored Aug 25, 2022
1 parent 5634df7 commit cd8f077
Show file tree
Hide file tree
Showing 10 changed files with 272 additions and 203 deletions.
5 changes: 4 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
.dockerignore
*.mp4
*.ts
/segmented
/hls
/hls2
docker/
/docker/*
Makefile
*Dockerfile*
22 changes: 17 additions & 5 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@ jobs:
build:
name: Build and publish docker images
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
strategy:
fail-fast: true
fail-fast: false
matrix:
arrays: [
{"name": "loadtester", "file": "Dockerfile.load-tester"},
Expand All @@ -36,21 +39,30 @@ jobs:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- 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: livepeer/${{ matrix.arrays.name }}
images: |
livepeer/${{ matrix.arrays.name }}
ghcr.io/${{ github.repository }}/${{ matrix.arrays.name }}
tags: |
type=schedule,pattern={{date 'YYYYMMDDHHmmss'}}
type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
type=sha
type=sha,format=long
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=${{github.event.pull_request.head.ref}}
type=semver,pattern={{version}},prefix=v
type=semver,pattern={{major}}.{{minor}},prefix=v
type=raw,value=${{ github.event.pull_request.head.ref }}
- name: Build and push
uses: docker/build-push-action@v3
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
ref: ${{ github.event.pull_request.head.sha }}

- name: Restore go modules cache
id: cache-go-mod
uses: actions/cache@v3
with:
path: |
Expand All @@ -40,5 +41,12 @@ jobs:

- name: Trigger test suite
run: |
# Skip orch-tester, because we not released as a binary
go test $(go list ./... | grep -v 'orch-tester') -v
# ignoring orch-tester
go test $(go list ./... | grep -v "orch-tester") --short -v --covermode=atomic --coverprofile=coverage.out
- name: Upload coverage reports
uses: codecov/codecov-action@v3
with:
files: ./coverage.out
name: ${{ github.event.repository.name }}
verbose: true
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ api-transcoder:

.PHONY: docker
docker:
docker build -t livepeer/streamtester:latest --build-arg version=$(shell git describe --dirty) .
docker build -f docker/Dockerfile -t livepeer/streamtester:latest --build-arg version=$(shell git describe --dirty) .

.PHONY: push
push:
docker push livepeer/streamtester:latest

.PHONY: localdocker
localdocker:
docker build -f Dockerfile.debian -t livepeer/streamtester:latest --build-arg version=$(shell git describe --dirty) .
docker build -f docker/Dockerfile.debian -t livepeer/streamtester:latest --build-arg version=$(shell git describe --dirty) .

.PHONY: release
release:
Expand Down
Loading

0 comments on commit cd8f077

Please sign in to comment.