Update docker-image.yml #11
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
name: Build and Push Multi-Platform Docker Image | |
on: | |
push: | |
branches: | |
- master # Trigger on pushes to the master branch | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the repository | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Log in to Docker Hub | |
run: echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login -u "${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin | |
- name: Build and push multi-platform Docker image | |
run: | | |
docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 --push \ | |
-t ${{ secrets.DOCKERHUB_USERNAME }}/slackonos:latest . | |
- name: Verify the platforms | |
run: docker buildx inspect --bootstrap |