From d6e1cdaf2d654b60c36043175a3c969c7af02e52 Mon Sep 17 00:00:00 2001 From: Kashif Sohail Date: Tue, 14 Dec 2021 21:07:27 +0500 Subject: [PATCH] used builtin actions. --- .github/workflows/docker-image.yml | 61 +++++++++++++++++------------- 1 file changed, 34 insertions(+), 27 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 480d2353..b821b5f5 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -1,28 +1,35 @@ -name: Docker Build/Publish Image -on: - push: - branches: [ master ] -jobs: - build: - runs-on: ubuntu-18.04 - env: - DOCKER_IMAGE: kshfse/dashy - DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} - DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} - TARGETPLATFORM: linux/arm/v7 - steps: - - name: Checkout the code - uses: actions/checkout@v1 - - name: Set up Docker Buildx - uses: crazy-max/ghaction-docker-buildx@v1 - with: - version: latest - - name: Docker Login - if: success() - run: | - echo "${DOCKER_PASSWORD}" | docker login --username "${DOCKER_USERNAME}" --password-stdin - - name: Run Buildx (push image) - if: success() - run: | - docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 --tag kshfse/dashy:latest --file ./docker/Dockerfile-multi-arch --output type=image,push=true . +name: Build Multiplatform Image +on: + push: + branches: + - 'master' + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v2 + - + name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - + name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - + name: Build and push + uses: docker/build-push-action@v2 + with: + context: . + dockerfile: ./docker/Dockerfile-multi-arch + platforms: linux/amd64,linux/arm64,linux/arm/v7 + push: true + tags: ${{ secrets.DOCKER_REPO }}:latest