Skip to content

Merge branch 'main' into dependabot/github_actions/actions/configure-… #1738

Merge branch 'main' into dependabot/github_actions/actions/configure-…

Merge branch 'main' into dependabot/github_actions/actions/configure-… #1738

name: Bytes Create container image
on:
push:
paths:
- bytes/**
- .github/workflows/bytes_container_image.yml
pull_request:
paths:
- bytes/**
- .github/workflows/bytes_container_image.yml
jobs:
create_container_image:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
ghcr.io/${{ github.repository_owner }}/nl-kat-bytes
tags: |
type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
id: buildx
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Generate version.py
run: |
pip install setuptools-scm==7.1.0
python -m setuptools_scm
cp _version.py bytes/bytes/version.py
- name: Build container image
uses: docker/build-push-action@v4
with:
# We don't use git context because that doesn't process .dockerignore
# https://github.com/docker/cli/issues/2827
context: bytes
push: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.owner.login == github.event.pull_request.base.repo.owner.login }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max