Update docker-image.yml #73
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: Docker Image CI | |
on: | |
push: | |
branches: [main] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
DOCKER_PLATFORMS: linux/amd64,linux/armhf,linux/arm64 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: setup docker buildx | |
uses: docker/setup-buildx-action@v3 | |
id: buildx | |
with: | |
install: true | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.PAT_TOKEN }} | |
- name: Build and publish the multiplatform Docker Image | |
run: | | |
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes | |
docker buildx build \ | |
--file Dockerfile \ | |
--platform linux/amd64,linux/armhf,linux/arm64 \ | |
-t ${{ secrets.DOCKER_USERNAME }}/docker-pharos-control \ | |
--cache-from type=gha \ | |
--cache-from type=inline \ | |
--cache-from type=registry,ref=${{ secrets.DOCKER_USERNAME }}/docker-pharos-control:latest \ | |
--cache-to type=registry,ref=${{ secrets.DOCKER_USERNAME }}/docker-pharos-control:latest \ | |
--progress=plain --push . | |
docker buildx imagetools inspect ${{ secrets.DOCKER_USERNAME }}/docker-pharos-control:latest | |
- name: Build and publish the multiplatform Docker Image | |
run: | | |
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes | |
docker buildx build \ | |
--file Dockerfile \ | |
--platform linux/amd64,linux/armhf,linux/arm64 \ | |
-t ghcr.io/${{ secrets.DOCKER_USERNAME }}/docker-pharos-control:latest \ | |
--cache-from type=gha \ | |
--cache-from type=inline \ | |
--cache-from type=registry,ref=ghcr.io/${{ secrets.DOCKER_USERNAME }}/docker-pharos-control:latest \ | |
--cache-to type=registry,ref=ghcr.io/${{ secrets.DOCKER_USERNAME }}/docker-pharos-control:latest \ | |
--progress=plain --push . | |
docker buildx imagetools inspect ghcr.io/${{ secrets.DOCKER_USERNAME }}/docker-pharos-control:latest | |
# - name: Docker Hub Description | |
# uses: peter-evans/dockerhub-description@v3 | |
# with: | |
# username: ${{ secrets.DOCKER_USERNAME }} | |
# password: ${{ secrets.DOCKER_PASSWORD }} | |
# repository: peterevans/dockerhub-description | |
# enable-url-completion: true |