Skip to content

Add Container Image release workflow #562

Add Container Image release workflow

Add Container Image release workflow #562

Workflow file for this run

name: CI
on: [push, pull_request]
env:
COLORTERM: 'yes'
TERM: 'xterm-256color'
PYTEST_ADDOPTS: '--color=yes'
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
python:
- "3.6"
- "3.7"
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: pip install -r requirements-test.txt
- name: Install RPM tools
run : |
sudo curl --create-dirs -o /usr/local/bin/spectool https://pagure.io/rpmdevtools/raw/26a8abc746fba9c0b32eb899b96c92841a37855a/f/spectool.in
sudo curl --create-dirs -o /usr/local/bin/rpmdev-bumpspec https://pagure.io/rpmdevtools/raw/6f387c1deaa5cbed770310e288abde04b17421dc/f/rpmdev-bumpspec
sudo curl --create-dirs -o /usr/local/bin/rpmdev-packager https://pagure.io/rpmdevtools/raw/main/f/rpmdev-packager
sudo chmod +x /usr/local/bin/*
sudo apt-get update && sudo apt-get install -y git-annex rpm
- name: Run tests
run: tox
container:
runs-on: ubuntu-latest
steps:
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build container
uses: docker/build-push-action@v5
with:
file: Containerfile
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
REPO=${{ github.repository }}
VERSION=${{ github.ref }}
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Install dependencies
run: pip install tox
- name: Run tests
run: tox -e ansible-lint