From 18bbefc654b2c78cf1cdb1eeee0ac8b00a13ed99 Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Thu, 6 Aug 2020 10:54:52 +0530 Subject: Update action.yml --- .github/workflows/action.yml | 53 ++++++++++++-------------------------------- 1 file changed, 14 insertions(+), 39 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/action.yml b/.github/workflows/action.yml index c4b1a35..a9e3f87 100644 --- a/.github/workflows/action.yml +++ b/.github/workflows/action.yml @@ -1,25 +1,20 @@ -name: buildx +name: Curie-CLI Build on: push jobs: - buildx: + docker-hub: + name: Deployment runs-on: ubuntu-latest steps: - - - name: Checkout - uses: actions/checkout@v2 - - - name: Prepare - id: prepare + - uses: actions/checkout@v2 + - name: Prepare run: | DOCKER_IMAGE=navanchauhan/curie-cli - DOCKER_PLATFORMS=linux/amd64,linux/arm64] - VERSION=edge - + DOCKER_PLATFORMS=linux/amd64,linux/arm64 + VERSION=latest TAGS="--tag ${DOCKER_IMAGE}:${VERSION}" - TAGS="$TAGS --tag ${DOCKER_IMAGE}:latest" echo ::set-output name=docker_image::${DOCKER_IMAGE} echo ::set-output name=version::${VERSION} @@ -27,34 +22,14 @@ jobs: --build-arg VERSION=${VERSION} \ --build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') \ --build-arg VCS_REF=${GITHUB_SHA::8} \ - ${TAGS} --file ./Dockerfile - - - name: Set up Docker Buildx + ${TAGS} + - name: Prepare Buildx uses: crazy-max/ghaction-docker-buildx@v3 - - - name: Docker Buildx (build) - run: | - docker buildx build --output "type=image,push=false" ${{ steps.prepare.outputs.buildx_args }} - - - name: Docker Login - if: success() && github.event_name != 'pull_request' + - name: Docker Login env: DOCKER_USERNAME: ${{ secrets.DOCKER_HUB_USER }} DOCKER_PASSWORD: ${{ secrets.DOCKER_HUB_TOKEN }} - run: | - echo "${DOCKER_PASSWORD}" | docker login --username "${DOCKER_USERNAME}" --password-stdin - - - name: Docker Buildx (push) - if: success() && github.event_name != 'pull_request' - run: | - docker buildx build --output "type=image,push=true" ${{ steps.prepare.outputs.buildx_args }} - - - name: Docker Check Manifest - if: always() && github.event_name != 'pull_request' - run: | - docker run --rm mplatform/mquery ${{ steps.prepare.outputs.docker_image }}:${{ steps.prepare.outputs.version }} - - - name: Clear - if: always() && github.event_name != 'pull_request' - run: | - rm -f ${HOME}/.docker/config.json + run: echo "${DOCKER_PASSWORD}" | docker login --username "${DOCKER_USERNAME}" --password-stdin + - name: Docker Buildx (push) + run: docker buildx build --output "type=image,push=true" ${{ steps.prepare.outputs.buildx_args }} + -- cgit v1.2.3