aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/action.yml
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows/action.yml')
-rw-r--r--.github/workflows/action.yml35
1 files changed, 25 insertions, 10 deletions
diff --git a/.github/workflows/action.yml b/.github/workflows/action.yml
index 3ec75c1..b3b7284 100644
--- a/.github/workflows/action.yml
+++ b/.github/workflows/action.yml
@@ -9,13 +9,28 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- - name: Deploy Step
- uses: docker/build-push-action@v1
- with:
- username: ${{ secrets.DOCKER_HUB_USER }}
- password: ${{ secrets.DOCKER_HUB_TOKEN }}
- #repository: navanchauhan/curie-cli
- #tag_with_ref: true
- tags: latest
- #image: navanchauhan/curie-cli
- registry: docker.io
+ - name: Prepare
+ id: prepare
+ run: |
+ DOCKER_IMAGE=navanchauhan/curie-cli
+ DOCKER_PLATFORMS=linux/amd64,linux/arm64
+ VERSION=latest
+ TAGS="--tag ${DOCKER_IMAGE}:${VERSION}"
+
+ echo ::set-output name=docker_image::${DOCKER_IMAGE}
+ echo ::set-output name=version::${VERSION}
+ echo ::set-output name=buildx_args::--platform ${DOCKER_PLATFORMS} \
+ --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: Prepare Buildx
+ uses: crazy-max/ghaction-docker-buildx@v3
+ - 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)
+ run: docker buildx build --output "type=image,push=true" ${{ steps.prepare.outputs.buildx_args }}
+