Skip to content

Build Centos Pypa Aarch64 & x86_64 Rust Image #84

Build Centos Pypa Aarch64 & x86_64 Rust Image

Build Centos Pypa Aarch64 & x86_64 Rust Image #84

name: Build Centos Pypa Aarch64 & x86_64 Rust Image
on:
push:
branches:
- main
paths:
- 'centos-pypa-aarch64/*'
- 'centos-pypa-x86_64/*'
- '.github/workflows/build-centos-pypa-rust.yml'
pull_request:
paths:
- 'centos-pypa-aarch64/*'
- 'centos-pypa-x86_64/*'
- '.github/workflows/build-centos-pypa-rust.yml'
workflow_dispatch:
schedule:
- cron: '30 12 * * 5'
concurrency:
# SHA is added to the end if on `main` to let all main workflows run
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ github.ref == 'refs/heads/main' && github.sha || '' }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
arch: [aarch64, x86_64]
steps:
- uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Docker meta aarch64
if: matrix.arch == 'aarch64'
id: meta_aarch64
uses: docker/metadata-action@v4
with:
images: |
ghcr.io/${{ github.repository }}/centos-pypa-rust-aarch64
# generate Docker tags based on the following events/attributes
# latest is only tagged if we're on the default branch
tags: |
type=raw,value=latest,enable=${{ endsWith(github.ref, github.event.repository.default_branch) }}
type=sha,format=long
- name: Build Docker Container
if: matrix.arch == 'aarch64'
uses: docker/build-push-action@v4
with:
context: ./centos-pypa-rust-aarch64
file: ./centos-pypa-rust-aarch64/Dockerfile
push: true
platforms: linux/arm64
tags: ${{ steps.meta_aarch64.outputs.tags }}
- name: Docker meta aarch64
if: matrix.arch == 'x86_64'
id: meta_x86_64
uses: docker/metadata-action@v4
with:
images: |
ghcr.io/${{ github.repository }}/centos-pypa-rust-x86_64
# generate Docker tags based on the following events/attributes
# latest is only tagged if we're on the default branch
tags: |
type=raw,value=latest,enable=${{ endsWith(github.ref, github.event.repository.default_branch) }}
type=sha,format=long
- name: Build Docker Container
if: matrix.arch == 'x86_64'
uses: docker/build-push-action@v4
with:
context: ./centos-pypa-rust-x86_64
file: ./centos-pypa-rust-x86_64/Dockerfile
push: true
platforms: linux/amd64
tags: ${{ steps.meta_x86_64.outputs.tags }}