-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
11 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,77 +3,29 @@ name: Build and Push Multi-Platform Docker Image | |
on: | ||
push: | ||
branches: | ||
- master | ||
- master # Trigger on pushes to the master branch | ||
|
||
jobs: | ||
build-amd64: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout the repository | ||
uses: actions/[email protected] | ||
|
||
- name: Docker Setup QEMU for amd64 | ||
uses: docker/[email protected] | ||
|
||
- name: Set up Docker Buildx for amd64 | ||
uses: docker/[email protected] | ||
|
||
- name: Log in to Docker Hub for amd64 | ||
run: echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login -u "${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin | ||
|
||
- name: Build and push Docker image for amd64 | ||
run: | | ||
docker buildx build --platform linux/amd64 --push \ | ||
-t ${{ secrets.DOCKERHUB_USERNAME }}/slackonos:amd64-latest . | ||
build-arm64: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout the repository | ||
uses: actions/[email protected] | ||
|
||
- name: Docker Setup QEMU for arm64 | ||
- name: Docker Setup QEMU | ||
uses: docker/[email protected] | ||
|
||
- name: Set up Docker Buildx for arm64 | ||
- name: Set up Docker Buildx | ||
uses: docker/[email protected] | ||
|
||
- name: Log in to Docker Hub for arm64 | ||
- name: Log in to Docker Hub | ||
run: echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login -u "${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin | ||
|
||
- name: Build and push Docker image for arm64 | ||
- name: Build and push multi-platform Docker image | ||
run: | | ||
docker buildx build --platform linux/arm64 --push \ | ||
-t ${{ secrets.DOCKERHUB_USERNAME }}/slackonos:arm64-latest . | ||
build-armv7: | ||
runs-on: ubuntu-latest | ||
docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 --push \ | ||
-t ${{ secrets.DOCKERHUB_USERNAME }}/slackonos:latest . | ||
steps: | ||
- name: Checkout the repository | ||
uses: actions/[email protected] | ||
|
||
- name: Docker Setup QEMU for armv7 | ||
uses: docker/[email protected] | ||
|
||
- name: Set up Docker Buildx for armv7 | ||
uses: docker/[email protected] | ||
|
||
- name: Log in to Docker Hub for armv7 | ||
run: echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login -u "${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin | ||
|
||
- name: Build and push Docker image for armv7 | ||
run: | | ||
docker buildx build --platform linux/arm/v7 --push \ | ||
-t ${{ secrets.DOCKERHUB_USERNAME }}/slackonos:armv7-latest . | ||
verify-manifest: | ||
needs: [build-amd64, build-arm64, build-armv7] | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Verify the multi-platform image | ||
run: | | ||
docker buildx imagetools inspect ${{ secrets.DOCKERHUB_USERNAME }}/slackonos:latest | ||
- name: Verify the platforms | ||
run: docker buildx inspect --bootstrap |