Skip to content

Commit

Permalink
Update docker-image.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
htilly authored Sep 6, 2024
1 parent e35088c commit b7d5f4e
Showing 1 changed file with 11 additions and 59 deletions.
70 changes: 11 additions & 59 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit b7d5f4e

Please sign in to comment.