Skip to content

Fix index obs (#548) #99

Fix index obs (#548)

Fix index obs (#548) #99

name: "Publish Docker images to Docker Registry"
on:
pull_request:
paths:
- ./mantis-control-plane/Dockerfile
- ./mantis-server/mantis-server-agent/Dockerfile
- .github/workflows/push-docker-image.yml
push:
tags:
- v*.*.*
- v*.*.*-rc.*
release:
types:
- published
jobs:
build-and-push-image:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- dockerfile: ./mantis-control-plane/Dockerfile
image: "netflixoss/mantiscontrolplaneserver"
workingDirectory: ./mantis-control-plane
- dockerfile: ./mantis-server/mantis-server-agent/Dockerfile
image: "netflixoss/mantisagent"
workingDirectory: ./mantis-server/mantis-server-agent
permissions:
contents: read
packages: write
steps:
- name: Checkout PR
uses: actions/checkout@v3
- name: Build executable
uses: gradle/gradle-build-action@v2
env:
NETFLIX_OSS_SIGNING_KEY: ${{ secrets.ORG_SIGNING_KEY }}
NETFLIX_OSS_SIGNING_PASSWORD: ${{ secrets.ORG_SIGNING_PASSWORD }}
NETFLIX_OSS_REPO_USERNAME: ${{ secrets.ORG_NETFLIXOSS_USERNAME }}
NETFLIX_OSS_REPO_PASSWORD: ${{ secrets.ORG_NETFLIXOSS_PASSWORD }}
with:
arguments: installDist
- name: Fetch tags
run: |
git fetch --prune --unshallow --tags
- name: Login to Docker Hub
id: login-docker-hub
uses: docker/login-action@v2
with:
username: ${{ secrets.ORG_NETFLIXOSS_DOCKERHUB_USERNAME }}
password: ${{ secrets.ORG_NETFLIXOSS_DOCKERHUB_PASSWORD }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
# list of Docker images to use as base name for tags
images: ${{ matrix.image }}
# generate Docker tags based on the following events/attributes
# we generate the latest tag off the beta branch
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=latest,enable=${{ github.event_name == 'release' }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and push Docker images
uses: docker/build-push-action@v3
with:
context: ${{ matrix.workingDirectory }}
file: ${{ matrix.dockerfile }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}