-
-
Notifications
You must be signed in to change notification settings - Fork 5
36 lines (34 loc) · 1.32 KB
/
image.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
name: image
on:
pull_request:
paths: [docker/*, .github/workflows/image.yml]
push:
branches: [main, test-me-*]
paths: [docker/*, .github/workflows/image.yml]
concurrency:
# serialize runs on the default branch
group: ${{ github.event_name == 'push' && github.workflow || github.sha }}${{ github.workflow }}
jobs:
image:
strategy:
matrix:
arch: [amd64, arm64]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: enable cross build
run: docker run --rm --privileged tonistiigi/binfmt --install arm64
if: matrix.arch == 'arm64'
- name: login
run: docker login --username '${{ github.actor }}' --password-stdin ghcr.io <<< '${{ secrets.GITHUB_TOKEN }}'
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
- name: build
run: |
docker buildx build \
--cache-from ghcr.io/getsentry/pypi-manylinux-${{ matrix.arch }}-ci:latest \
--cache-to type=inline \
--platform linux/${{ matrix.arch }} \
--tag ghcr.io/getsentry/pypi-manylinux-${{ matrix.arch }}-ci:${{ github.sha }} \
--tag ghcr.io/getsentry/pypi-manylinux-${{ matrix.arch }}-ci:latest \
${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && '--push' || '' }} \
docker