-
Notifications
You must be signed in to change notification settings - Fork 1
88 lines (77 loc) · 2.74 KB
/
build-centos-pypa-rust.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
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:
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 }}