Add platform to the the image name. #40
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: Docker image for cibuildwheel | |
on: | |
push: | |
paths: | |
- 'cibuildwheel/**' | |
- '.github/workflows/image_cibuildwheel.yml' | |
branches: | |
- master | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
build: | |
strategy: | |
matrix: | |
platform: ["x86_64"] | |
base_image: ["manylinux2014"] | |
r-version: ["4.3.2"] | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- | |
name: Check out the repos | |
uses: actions/checkout@v3 | |
- | |
name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- | |
name: Log in to the Container registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- | |
name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
- | |
name: Build and push base yum image from ${{ matrix.base_image }} | |
uses: docker/build-push-action@v3 | |
with: | |
context: "cibuildwheel" | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ env.REGISTRY }}/${{ github.repository }}/${{ matrix.base_image }}_${{ matrix.platform }}:r${{ matrix.r-version }} | |
file: "cibuildwheel/manylinux2014_Dockerfile" | |
build-args: | | |
PLATFORM=${{ matrix.platform }} | |
YUM_BASE_IMAGE=quay.io/pypa/${{ matrix.base_image }} | |
R_VERSION=${{ matrix.r-version }} |