Skip to content

oxe-api Docker build #110

oxe-api Docker build

oxe-api Docker build #110

Workflow file for this run

name: oxe-api Docker build
on:
push:
tags: [ 'v*.*', 'v*.*.*' ]
paths:
- 'oxe-api/**'
defaults:
run:
working-directory: oxe-api/
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
COMPONENT: oxe-api
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-${{ env.COMPONENT }}
# https://github.com/docker/build-push-action
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
file: oxe-api/docker/Dockerfile
context: oxe-api/
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
"PYTHON_VERSION=3.8-slim-buster"