Skip to content

Commit 178beab

Browse files
committed
Native arm runners
1 parent 2f823a9 commit 178beab

File tree

2 files changed

+90
-22
lines changed

2 files changed

+90
-22
lines changed

.github/workflows/build-ai-dev.yml

Lines changed: 45 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,19 @@ env:
3131

3232
jobs:
3333
build:
34-
runs-on: ubuntu-latest-m
34+
runs-on: ${{ matrix.runner }}
3535
# Skip if triggered by failed nvim-dev workflow
3636
if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }}
37+
strategy:
38+
fail-fast: false
39+
matrix:
40+
include:
41+
- platform: linux/amd64
42+
runner: ubuntu-latest-m
43+
suffix: amd64
44+
- platform: linux/arm64
45+
runner: ubuntu-latest-m-arm
46+
suffix: arm64
3747
permissions:
3848
contents: read
3949
packages: write
@@ -42,9 +52,6 @@ jobs:
4252
- name: Checkout repository
4353
uses: actions/checkout@v6
4454

45-
- name: Set up QEMU
46-
uses: docker/setup-qemu-action@v3
47-
4855
- name: Set up Docker Buildx
4956
uses: docker/setup-buildx-action@v3
5057

@@ -62,24 +69,51 @@ jobs:
6269
with:
6370
images: ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}
6471
tags: |
65-
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
66-
type=sha,prefix=
67-
type=ref,event=pr
72+
type=raw,value=latest-${{ matrix.suffix }},enable=${{ github.ref == 'refs/heads/main' }}
73+
type=sha,prefix=,suffix=-${{ matrix.suffix }}
74+
type=ref,event=pr,suffix=-${{ matrix.suffix }}
6875
6976
- name: Build and push
7077
uses: docker/build-push-action@v6
7178
with:
7279
context: dot_files/ai-dev
7380
file: dot_files/ai-dev/Containerfile
74-
platforms: linux/amd64,linux/arm64
81+
platforms: ${{ matrix.platform }}
7582
push: ${{ github.event_name != 'pull_request' }}
7683
tags: ${{ steps.meta.outputs.tags }}
7784
labels: ${{ steps.meta.outputs.labels }}
78-
cache-from: type=gha
79-
cache-to: type=gha,mode=max
85+
cache-from: type=gha,scope=${{ matrix.suffix }}
86+
cache-to: type=gha,mode=max,scope=${{ matrix.suffix }}
87+
88+
manifest:
89+
needs: build
90+
runs-on: ubuntu-latest
91+
if: github.event_name != 'pull_request'
92+
permissions:
93+
packages: write
94+
95+
steps:
96+
- name: Log in to GitHub Container Registry
97+
uses: docker/login-action@v3
98+
with:
99+
registry: ghcr.io
100+
username: ${{ github.actor }}
101+
password: ${{ secrets.GITHUB_TOKEN }}
102+
103+
- name: Create and push manifest
104+
run: |
105+
docker manifest create ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:latest \
106+
${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:latest-amd64 \
107+
${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:latest-arm64
108+
docker manifest push ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:latest
109+
110+
# Also create SHA manifest
111+
docker manifest create ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }} \
112+
${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}-amd64 \
113+
${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}-arm64
114+
docker manifest push ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}
80115
81116
- name: Generate build summary
82-
if: github.event_name != 'pull_request'
83117
run: |
84118
echo "## ai-dev Image Built" >> $GITHUB_STEP_SUMMARY
85119
echo "" >> $GITHUB_STEP_SUMMARY

.github/workflows/build-nvim-dev.yml

Lines changed: 45 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,17 @@ env:
3030

3131
jobs:
3232
build:
33-
runs-on: ubuntu-latest-m
33+
runs-on: ${{ matrix.runner }}
34+
strategy:
35+
fail-fast: false
36+
matrix:
37+
include:
38+
- platform: linux/amd64
39+
runner: ubuntu-latest-m
40+
suffix: amd64
41+
- platform: linux/arm64
42+
runner: ubuntu-latest-m-arm
43+
suffix: arm64
3444
permissions:
3545
contents: read
3646
packages: write
@@ -39,9 +49,6 @@ jobs:
3949
- name: Checkout repository
4050
uses: actions/checkout@v6
4151

42-
- name: Set up QEMU
43-
uses: docker/setup-qemu-action@v3
44-
4552
- name: Set up Docker Buildx
4653
uses: docker/setup-buildx-action@v3
4754

@@ -59,24 +66,51 @@ jobs:
5966
with:
6067
images: ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}
6168
tags: |
62-
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
63-
type=sha,prefix=
64-
type=ref,event=pr
69+
type=raw,value=latest-${{ matrix.suffix }},enable=${{ github.ref == 'refs/heads/main' }}
70+
type=sha,prefix=,suffix=-${{ matrix.suffix }}
71+
type=ref,event=pr,suffix=-${{ matrix.suffix }}
6572
6673
- name: Build and push
6774
uses: docker/build-push-action@v6
6875
with:
6976
context: dot_files/nvim
7077
file: dot_files/nvim/Containerfile
71-
platforms: linux/amd64,linux/arm64
78+
platforms: ${{ matrix.platform }}
7279
push: ${{ github.event_name != 'pull_request' }}
7380
tags: ${{ steps.meta.outputs.tags }}
7481
labels: ${{ steps.meta.outputs.labels }}
75-
cache-from: type=gha
76-
cache-to: type=gha,mode=max
82+
cache-from: type=gha,scope=${{ matrix.suffix }}
83+
cache-to: type=gha,mode=max,scope=${{ matrix.suffix }}
84+
85+
manifest:
86+
needs: build
87+
runs-on: ubuntu-latest
88+
if: github.event_name != 'pull_request'
89+
permissions:
90+
packages: write
91+
92+
steps:
93+
- name: Log in to GitHub Container Registry
94+
uses: docker/login-action@v3
95+
with:
96+
registry: ghcr.io
97+
username: ${{ github.actor }}
98+
password: ${{ secrets.GITHUB_TOKEN }}
99+
100+
- name: Create and push manifest
101+
run: |
102+
docker manifest create ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:latest \
103+
${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:latest-amd64 \
104+
${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:latest-arm64
105+
docker manifest push ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:latest
106+
107+
# Also create SHA manifest
108+
docker manifest create ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }} \
109+
${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}-amd64 \
110+
${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}-arm64
111+
docker manifest push ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}
77112
78113
- name: Generate build summary
79-
if: github.event_name != 'pull_request'
80114
run: |
81115
echo "## nvim-dev Image Built" >> $GITHUB_STEP_SUMMARY
82116
echo "" >> $GITHUB_STEP_SUMMARY

0 commit comments

Comments
 (0)