Skip to content

Commit 0feaad3

Browse files
committed
feat: add support to docker multi-platform
1 parent 3f24eb1 commit 0feaad3

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

.github/workflows/docker-publish-on-release.yml

+18-5
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@ on:
55
types:
66
- published
77

8+
permissions:
9+
contents: read
10+
packages: write
11+
812
jobs:
913
build-and-push:
10-
name: Build and Push Docker Image
14+
name: Build and Push Multi-Platform Docker Image
1115
runs-on: ubuntu-latest
1216

1317
steps:
@@ -23,17 +27,26 @@ jobs:
2327

2428
- name: Set up Docker Buildx
2529
uses: docker/setup-buildx-action@v2
30+
with:
31+
install: true
32+
33+
- name: Set Lowercase Repository Info
34+
id: repo_info
35+
run: |
36+
echo "REPO_OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
37+
echo "REPO_NAME=$(echo ${{ github.event.repository.name }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
2638
27-
- name: Build and Push Docker Image
39+
- name: Build and Push Multi-Platform Docker Image
2840
uses: docker/build-push-action@v5
2941
with:
3042
context: .
3143
push: true
44+
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/s390x,linux/ppc64le
3245
tags: |
33-
ghcr.io/${{ github.repository }}/fortsphere:latest
34-
ghcr.io/${{ github.repository }}/fortsphere:${{ github.event.release.tag_name }}
46+
ghcr.io/${{ env.REPO_OWNER }}/${{ env.REPO_NAME }}:latest
47+
ghcr.io/${{ env.REPO_OWNER }}/${{ env.REPO_NAME }}:${{ github.event.release.tag_name }}
3548
labels: |
36-
org.opencontainers.image.title=Fortsphere
49+
org.opencontainers.image.title=fortsphere
3750
org.opencontainers.image.description="Fortify your digital sphere, one command at a time."
3851
org.opencontainers.image.url=https://github.com/OpenPathfinder/fortSphere
3952
org.opencontainers.image.source=https://github.com/OpenPathfinder/fortSphere.git

0 commit comments

Comments
 (0)