-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (56 loc) · 1.71 KB
/
build-image-base.yaml
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
name: Docker Image (Base)
on:
push:
branches: [main]
paths:
- "base/Dockerfile"
- "base/requirements.txt"
workflow_dispatch:
jobs:
build-push:
strategy:
matrix:
python:
- "3.8"
- "3.9"
- "3.10"
name: Build mrx-link-base image (Python ${{ matrix.python }})
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ secrets.ORG_PAT }}
fetch-depth: 0
lfs: true
submodules: true
- name: Create short SHA
uses: benjlevesque/[email protected]
id: short-sha
with:
length: 7
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.ORG_PAT }}
- name: Build and push mrx-link-base
uses: docker/build-push-action@v2
with:
platforms: linux/amd64,linux/arm64
push: true
context: ./base
file: ./base/Dockerfile
tags: |
ghcr.io/makinarocks/mrx-link-base:python${{ matrix.python }}
ghcr.io/makinarocks/mrx-link-base:python${{ matrix.python }}-latest
ghcr.io/makinarocks/mrx-link-base:python${{ matrix.python }}-${{ steps.short-sha.outputs.sha }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
build-args: |
BASE_IMAGE=python:${{ matrix.python }}-buster