Skip to content

Merge pull request #10 from rsharifnasab/main #87

Merge pull request #10 from rsharifnasab/main

Merge pull request #10 from rsharifnasab/main #87

Workflow file for this run

---
name: CI
on: push
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Golang ci-lint
uses: golangci/golangci-lint-action@v2
with:
version: latest
args: --enable-all
# test:
# name: Test
# runs-on: ubuntu-latest
# steps:
# - name: Setup Go environment
# uses: actions/setup-go@v2
# with:
# go-version: "1.17"
# - name: Checkout code
# uses: actions/checkout@v2
# - name: Run tests
# run: make unit-test
build-push:
name: Build & Push
runs-on: ubuntu-latest
needs:
- lint
# - test
strategy:
matrix:
command: [janus, ion-sfu]
env:
REGISTRY: ghcr.io
USERNAME: ${{ github.repository_owner }}
REPOSITORY: ${{ github.event.repository.name }}
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.17.x
- name: Checks out our project source code
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ env.USERNAME }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/metadata-action@v3
id: meta
with:
images: ${{ env.REGISTRY }}/${{ env.USERNAME }}/${{ env.REPOSITORY }}-${{ matrix.command }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Generate Dockerfile
run: |
render() {
sedStr="s!%%COMMAND%%!$command!g;"
sed -r "$sedStr" $1
}
command=${{ matrix.command }}
render build/template.Dockerfile > build/$command.Dockerfile
- uses: docker/build-push-action@v2
with:
file: "build/${{ matrix.command }}.Dockerfile"
context: .
platforms: linux/amd64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}