Skip to content

Commit ff258a9

Browse files
committedSep 1, 2024
fix: github actions
1 parent 0414fa2 commit ff258a9

File tree

1 file changed

+45
-8
lines changed

1 file changed

+45
-8
lines changed
 

‎.github/workflows/build.yml

+45-8
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,16 @@ on:
66

77
env:
88
IMAGE_NAME: pleisto/postgrs-extra
9+
910
jobs:
10-
build:
11-
runs-on: ubuntu-latest
11+
build-amd64:
12+
runs-on: ubuntu2404-pro-amd64
1213
permissions:
1314
contents: read
1415
packages: write
1516
steps:
16-
- name: Set up QEMU
17-
uses: docker/setup-qemu-action@v3
17+
- name: Checkout code
18+
uses: actions/checkout@v3
1819

1920
- name: Set up Docker Buildx
2021
uses: docker/setup-buildx-action@v3
@@ -31,14 +32,50 @@ jobs:
3132
uses: docker/metadata-action@v5
3233
with:
3334
images: ghcr.io/${{ env.IMAGE_NAME }}
34-
35-
- name: Build and push Docker image
35+
36+
- name: Build and push Docker image for AMD64
3637
uses: docker/build-push-action@v6
3738
with:
39+
context: .
3840
push: true
39-
platforms: linux/amd64,linux/arm64
41+
platforms: linux/amd64
4042
tags: ${{ steps.meta.outputs.tags }}
4143
labels: ${{ steps.meta.outputs.labels }}
4244
cache-from: type=gha
4345
cache-to: type=gha,mode=max
44-
46+
47+
build-arm64:
48+
runs-on: ubuntu2404-pro-arm64
49+
permissions:
50+
contents: read
51+
packages: write
52+
steps:
53+
- name: Checkout code
54+
uses: actions/checkout@v3
55+
56+
- name: Set up Docker Buildx
57+
uses: docker/setup-buildx-action@v3
58+
59+
- name: Login to GHCR
60+
uses: docker/login-action@v3
61+
with:
62+
registry: ghcr.io
63+
username: ${{ github.actor }}
64+
password: ${{ secrets.GITHUB_TOKEN }}
65+
66+
- name: Extract metadata
67+
id: meta
68+
uses: docker/metadata-action@v5
69+
with:
70+
images: ghcr.io/${{ env.IMAGE_NAME }}
71+
72+
- name: Build and push Docker image for ARM64
73+
uses: docker/build-push-action@v6
74+
with:
75+
context: .
76+
push: true
77+
platforms: linux/arm64
78+
tags: ${{ steps.meta.outputs.tags }}
79+
labels: ${{ steps.meta.outputs.labels }}
80+
cache-from: type=gha
81+
cache-to: type=gha,mode=max

0 commit comments

Comments
 (0)
Please sign in to comment.