Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build multi-platform images for both linux-amd64 and linux-arm64 runners #102

Merged
merged 3 commits into from Nov 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 12 additions & 3 deletions .github/workflows/autobuild.yml
Expand Up @@ -14,7 +14,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Set DOCKER_REPO_NAME env
run: echo DOCKER_REPO_NAME=$(basename ${GITHUB_REPOSITORY}) >> ${GITHUB_ENV}
- name: Set IMAGE_TAG env
Expand All @@ -27,22 +27,31 @@ jobs:
- name: Environment Printer
uses: managedkaos/print-env@v1.0

# Add support for more platforms with QEMU (optional)
# https://github.com/docker/setup-qemu-action
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build & Publish to Github Container Registry
uses: elgohr/Publish-Docker-Github-Action@master
uses: elgohr/Publish-Docker-Github-Action@v4
with:
name: ${{ github.actor }}/${{ env.DOCKER_REPO_NAME }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
platforms: linux/amd64,linux/arm64
registry: ghcr.io
snapshot: false
tags: "${{ env.IMAGE_TAG }}"

- name: Build & Publish to DockerHub
uses: elgohr/Publish-Docker-Github-Action@master
uses: elgohr/Publish-Docker-Github-Action@v4
with:
name: ${{ github.repository }}
username: ${{ github.actor }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
platforms: linux/amd64,linux/arm64
snapshot: false
tags: "${{ env.IMAGE_TAG }}"

2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Expand Up @@ -13,7 +13,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Environment Printer
uses: managedkaos/print-env@v1.0

Expand Down
15 changes: 11 additions & 4 deletions .github/workflows/release.yml
Expand Up @@ -15,7 +15,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Set DOCKER_REPO_NAME env
run: echo DOCKER_REPO_NAME=$(basename ${GITHUB_REPOSITORY}) >> ${GITHUB_ENV}
- name: Set IMAGE_TAG env
Expand All @@ -24,9 +24,16 @@ jobs:
run: echo IMAGE_TAG=${IMAGE_TAG},latest >> ${GITHUB_ENV}
- name: Environment Printer
uses: managedkaos/print-env@v1.0


# Add support for more platforms with QEMU (optional)
# https://github.com/docker/setup-qemu-action
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build & Publish to Github Container Registry
uses: elgohr/Publish-Docker-Github-Action@master
uses: elgohr/Publish-Docker-Github-Action@v4
with:
name: ${{ github.actor }}/${{ env.DOCKER_REPO_NAME }}
username: ${{ github.actor }}
Expand All @@ -37,7 +44,7 @@ jobs:
tags: "${{ env.IMAGE_TAG }}"

- name: Build & Publish to DockerHub
uses: elgohr/Publish-Docker-Github-Action@master
uses: elgohr/Publish-Docker-Github-Action@v4
with:
name: ${{ github.repository }}
username: ${{ github.actor }}
Expand Down