Skip to content

style: drop black in favor of ruff format #2199

style: drop black in favor of ruff format

style: drop black in favor of ruff format #2199

Workflow file for this run

name: Build Container Image
on:
push:
branches: [ main ]
tags:
- '*'
pull_request:
branches: [main, 'release/*']
env:
STABLE_TAG: ${{ github.event_name == 'push' && github.ref_name || format('pr-{0}', github.event.pull_request.number) }}
# We had a problem with GitHub setting quay expiration label also during
# merge to main, so we just set meaningless value as a workaround.
EXPIRATION_LABEL: ${{ github.event_name == 'push' && 'quipucords.source=github' || 'quay.expires-after=5d' }}
IMAGE_NAME: ${{ vars.IMAGE_NAME || 'quipucords/quipucords' }}
REGISTRY: ${{ vars.REGISTRY || 'quay.io' }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v2
with:
fetch-depth: 0 # fetches all commits/tags
- name: Build quipucords image
id: build-image
uses: redhat-actions/buildah-build@v2
with:
image: ${{ env.IMAGE_NAME }}
archs: amd64
tags: ${{ env.STABLE_TAG }} ${{ env.STABLE_TAG == 'main' && 'latest' || '' }}
containerfiles: |
./Dockerfile
labels: |
${{ env.EXPIRATION_LABEL }}
quipucords.backend.git_sha=${{ github.sha }}
- name: Push To quay.io
# Forks that do not set secrets and override the variables may fail this step.
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ env.IMAGE_NAME }}
tags: ${{ steps.build-image.outputs.tags }}
registry: ${{ env.REGISTRY }}
username: ${{ secrets.QUAYIO_USERNAME }}
password: ${{ secrets.QUAYIO_PASSWORD }}
continue-on-error: true