diff options
author | Navan Chauhan <navanchauhan@gmail.com> | 2020-08-06 10:54:52 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-06 10:54:52 +0530 |
commit | 18bbefc654b2c78cf1cdb1eeee0ac8b00a13ed99 (patch) | |
tree | b979fe6247cb52919961878a4bb9be18697f1004 | |
parent | bccd2f2378c8cbc252f88e9e3ae566228308812a (diff) |
Update action.yml
-rw-r--r-- | .github/workflows/action.yml | 53 |
1 files changed, 14 insertions, 39 deletions
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 }} + |