chore: sync using atmosphere-ci
#25
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build | |
concurrency: | |
group: ${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
on: | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
- reopened | |
push: | |
branches: | |
- main | |
jobs: | |
image: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
exclude: | |
- from: focal | |
release: zed | |
- from: focal | |
release: "2023.1" | |
- from: jammy | |
release: wallaby | |
- from: jammy | |
release: xena | |
from: | |
- focal | |
- jammy | |
release: | |
- wallaby | |
- xena | |
- yoga | |
- zed | |
- "2023.1" | |
steps: | |
- name: Install QEMU static binaries | |
uses: docker/setup-qemu-action@v2 | |
- name: Configure Buildkit | |
uses: docker/setup-buildx-action@v2 | |
- name: Checkout project | |
uses: actions/checkout@v3 | |
- name: Setup environment variables | |
run: echo PROJECT_REF=$(cat manifest.yml | yq '."${{ matrix.release }}".sha') >> $GITHUB_ENV | |
- name: Authenticate with Quay.io | |
uses: docker/login-action@v2 | |
if: ${{ github.event_name == 'push' }} | |
with: | |
password: ${{ secrets.QUAY_ROBOT_TOKEN }} | |
registry: quay.io | |
username: ${{ secrets.QUAY_USERNAME }} | |
- name: Build image | |
uses: docker/build-push-action@v3 | |
with: | |
build-args: |- | |
BUILDER_IMAGE=quay.io/vexxhost/openstack-builder-${{ matrix.from }} | |
RUNTIME_IMAGE=quay.io/vexxhost/openstack-runtime-${{ matrix.from }} | |
RELEASE=${{ matrix.release }} | |
PROJECT=cinder | |
PROJECT_REPO=https://github.com/openstack/cinder | |
PROJECT_REF=${{ env.PROJECT_REF }} | |
EXTRAS= | |
PROFILES=ceph qemu | |
DIST_PACKAGES=kubectl lsscsi nvme-cli sysfsutils udev util-linux | |
PIP_PACKAGES=cryptography python-binary-memcached purestorage | |
cache-from: type=gha,scope=${{ matrix.from }}-${{ matrix.release }} | |
cache-to: type=gha,mode=max,scope=${{ matrix.from }}-${{ matrix.release }} | |
context: . | |
platforms: linux/amd64 | |
push: ${{ github.event_name == 'push' }} | |
tags: quay.io/vexxhost/cinder:${{ env.PROJECT_REF }}-${{ matrix.from }} | |
- name: Promote image | |
uses: akhilerm/[email protected] | |
if: github.event_name == 'push' && ((matrix.from == 'focal') || (matrix.from == 'jammy' && matrix.release != 'yoga')) | |
with: | |
dst: quay.io/vexxhost/cinder:${{ matrix.release }} | |
src: quay.io/vexxhost/cinder:${{ env.PROJECT_REF }}-${{ matrix.from }} |